From ae99784372db8d8d84783c0149efaa70b1ec5bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Mon, 19 May 2014 22:22:56 +0200 Subject: [PATCH] Enabled reload always when DEBUG==True. --- openslides/__main__.py | 7 +++---- openslides/utils/tornado_webserver.py | 4 ++-- tests/utils/test_main.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/openslides/__main__.py b/openslides/__main__.py index 9446265fb..f0e8b75e0 100644 --- a/openslides/__main__.py +++ b/openslides/__main__.py @@ -104,7 +104,6 @@ def parse_args(): '--start-browser', action='store_true', help='Launch the default web browser and open the webinterface.') - subcommand_runserver.set_defaults(callback=runserver) # Subcommand syncdb @@ -218,10 +217,10 @@ def start(settings, args): ensure_settings(settings, args) syncdb(settings, args) args.start_browser = not args.no_browser - runserver(settings, args, block_reload=True) + runserver(settings, args) -def runserver(settings, args, block_reload=False): +def runserver(settings, args): """ Runs tornado webserver. Runs the function start_browser if the respective argument is given. @@ -234,7 +233,7 @@ def runserver(settings, args, block_reload=False): # Now the settings is available and the function can be imported. from openslides.utils.tornado_webserver import run_tornado - run_tornado(args.address, port, block_reload) + run_tornado(args.address, port) def syncdb(settings, args): diff --git a/openslides/utils/tornado_webserver.py b/openslides/utils/tornado_webserver.py index 6c767d7d0..2b4ff9092 100644 --- a/openslides/utils/tornado_webserver.py +++ b/openslides/utils/tornado_webserver.py @@ -68,7 +68,7 @@ class ProjectorSocketHandler(SockJSConnection): waiter.send(data) -def run_tornado(addr, port, block_reload=False): +def run_tornado(addr, port): # Don't try to read the command line args from openslides parse_command_line(args=[]) @@ -92,7 +92,7 @@ def run_tornado(addr, port, block_reload=False): ('.*', FallbackHandler, dict(fallback=app))] # Start the application - debug = False if block_reload else settings.DEBUG + debug = settings.DEBUG tornado_app = Application(projectpr_socket_js_router.urls + chatbox_socket_js_router.urls + other_urls, debug=debug) server = HTTPServer(tornado_app) server.listen(port=port, address=addr) diff --git a/tests/utils/test_main.py b/tests/utils/test_main.py index 6f8ea37aa..5ea30bc91 100644 --- a/tests/utils/test_main.py +++ b/tests/utils/test_main.py @@ -117,7 +117,7 @@ class TestOtherFunctions(TestCase): mock_args = MagicMock() start(settings=None, args=mock_args) self.assertTrue(mock_syncdb.called) - mock_runserver.assert_called_with(None, mock_args, block_reload=True) + mock_runserver.assert_called_with(None, mock_args) @patch('openslides.__main__.get_port') @patch('openslides.utils.tornado_webserver.run_tornado')