Enabled reload always when DEBUG==True.

This commit is contained in:
Norman Jäckel 2014-05-19 22:22:56 +02:00
parent 22bacd1054
commit ae99784372
3 changed files with 6 additions and 7 deletions

View File

@ -104,7 +104,6 @@ def parse_args():
'--start-browser', '--start-browser',
action='store_true', action='store_true',
help='Launch the default web browser and open the webinterface.') help='Launch the default web browser and open the webinterface.')
subcommand_runserver.set_defaults(callback=runserver) subcommand_runserver.set_defaults(callback=runserver)
# Subcommand syncdb # Subcommand syncdb
@ -218,10 +217,10 @@ def start(settings, args):
ensure_settings(settings, args) ensure_settings(settings, args)
syncdb(settings, args) syncdb(settings, args)
args.start_browser = not args.no_browser 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 Runs tornado webserver. Runs the function start_browser if the respective
argument is given. 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. # Now the settings is available and the function can be imported.
from openslides.utils.tornado_webserver import run_tornado from openslides.utils.tornado_webserver import run_tornado
run_tornado(args.address, port, block_reload) run_tornado(args.address, port)
def syncdb(settings, args): def syncdb(settings, args):

View File

@ -68,7 +68,7 @@ class ProjectorSocketHandler(SockJSConnection):
waiter.send(data) 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 # Don't try to read the command line args from openslides
parse_command_line(args=[]) parse_command_line(args=[])
@ -92,7 +92,7 @@ def run_tornado(addr, port, block_reload=False):
('.*', FallbackHandler, dict(fallback=app))] ('.*', FallbackHandler, dict(fallback=app))]
# Start the application # 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) tornado_app = Application(projectpr_socket_js_router.urls + chatbox_socket_js_router.urls + other_urls, debug=debug)
server = HTTPServer(tornado_app) server = HTTPServer(tornado_app)
server.listen(port=port, address=addr) server.listen(port=port, address=addr)

View File

@ -117,7 +117,7 @@ class TestOtherFunctions(TestCase):
mock_args = MagicMock() mock_args = MagicMock()
start(settings=None, args=mock_args) start(settings=None, args=mock_args)
self.assertTrue(mock_syncdb.called) 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.__main__.get_port')
@patch('openslides.utils.tornado_webserver.run_tornado') @patch('openslides.utils.tornado_webserver.run_tornado')