diff --git a/demo/moulinrouge.py b/demo/moulinrouge.py index 5dd6315..6201405 100755 --- a/demo/moulinrouge.py +++ b/demo/moulinrouge.py @@ -37,19 +37,6 @@ try: except: pass - -try: - import wsreload -except ImportError: - app.logger.debug('wsreload not found') -else: - url = "http://moulinrouge.l:21112/*" - - def log(httpserver): - app.logger.debug('WSReloaded after server restart') - wsreload.monkey_patch_http_server({'url': url}, callback=log) - app.logger.debug('HTTPServer monkey patched for url %s' % url) - try: from wdb.ext import WdbMiddleware, add_w_builtin except ImportError: diff --git a/demo/moulinrouge/__init__.py b/demo/moulinrouge/__init__.py index 2c96f9c..1e3e907 100644 --- a/demo/moulinrouge/__init__.py +++ b/demo/moulinrouge/__init__.py @@ -70,13 +70,13 @@ def create_app(): random_value((-max, min)[random.randrange(0, 2)], max), random_value((-max, min)[random.randrange(0, 2)], max) ) for i in range(data)] - series.append((random_label(), values)) + series.append((random_label(), values, {})) return series def _random_series(type, data, order): max = 10 ** order min = 10 ** random.randrange(0, order) - with_2nd = bool(random.randint(0, 1)) + with_secondary = bool(random.randint(0, 1)) series = [] for i in range(random.randrange(1, 10)): if type == 'Pie': @@ -89,10 +89,10 @@ def create_app(): else: values = [random_value((-max, min)[random.randrange(1, 2)], max) for i in range(data)] - is_2nd = False - if with_2nd: - is_2nd = bool(random.randint(0, 1)) - series.append((random_label(), values, is_2nd)) + config = { + 'secondary': with_secondary and bool(random.randint(0, 1)) + } + series.append((random_label(), values, config)) return series from .tests import get_test_routes @@ -110,15 +110,17 @@ def create_app(): def svg(type, series, config): graph = get(type)( pickle.loads(b64decode(str(config)))) - for title, values, is_2nd in pickle.loads(b64decode(str(series))): - graph.add(title, values, secondary=is_2nd) + for title, values, serie_config in pickle.loads( + b64decode(str(series))): + graph.add(title, values, **serie_config) return graph.render_response() @app.route("/table///") def table(type, series, config): graph = get(type)(pickle.loads(b64decode(str(config)))) - for title, values, is_2nd in pickle.loads(b64decode(str(series))): - graph.add(title, values, secondary=is_2nd) + for title, values, serie_config in pickle.loads( + b64decode(str(series))): + graph.add(title, values, **serie_config) return graph.render_table() @app.route("/sparkline/