Fixed error when starting webbrowser. Added info on port to general start script message.

This commit is contained in:
Norman Jäckel 2015-07-24 22:38:44 +02:00
parent eb7f2ac359
commit f9f1575ecc
3 changed files with 19 additions and 8 deletions

View File

@ -11,6 +11,13 @@ Version 1.7.1 (unreleased)
Motions: Motions:
- Show amendment button for users with permission 'can_create_motion' - Show amendment button for users with permission 'can_create_motion'
only. only.
- Fixed check_permission in motion support view.
- Fixed apply url for motion poll update view.
Assignments:
- Fixed tooltip to set a candidate as not elected.
Other:
- Fixed error when starting webbrowser.
- Added info on port to general start script message.
Version 1.7 (2015-02-16) Version 1.7 (2015-02-16)

View File

@ -281,15 +281,19 @@ def start_browser(browser_url):
Launches the default web browser at the given url and opens the Launches the default web browser at the given url and opens the
webinterface. webinterface.
""" """
browser = webbrowser.get() try:
browser = webbrowser.get()
except webbrowser.Error as e:
print('Web browser controller error: %s' % e)
else:
def function(): def function():
# TODO: Use a nonblocking sleep event here. Tornado has such features. # TODO: Use a nonblocking sleep event here. Tornado has such features.
time.sleep(1) time.sleep(1)
browser.open(browser_url) browser.open(browser_url)
thread = threading.Thread(target=function) thread = threading.Thread(target=function)
thread.start() thread.start()
def get_database_path_from_settings(): def get_database_path_from_settings():

View File

@ -74,7 +74,7 @@ def run_tornado(addr, port):
# Print listening address and port to command line # Print listening address and port to command line
if addr == '0.0.0.0': if addr == '0.0.0.0':
url_string = _("the machine's local ip address") url_string = _("the machine's local ip address (port %s)") % port
else: else:
url_string = 'http://%s:%s' % (addr, port) url_string = 'http://%s:%s' % (addr, port)
print _("Starting OpenSlides' tornado webserver listening to %(url_string)s") % {'url_string': url_string} print _("Starting OpenSlides' tornado webserver listening to %(url_string)s") % {'url_string': url_string}