diff --git a/.gitignore b/.gitignore index 4aae9de..4061018 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ *.pyo *.pyc .vscode/settings.json + +.vscode/ + +offset diff --git a/SpanshRouter/SpanshRouter.py b/SpanshRouter/SpanshRouter.py index ae0df9d..d2a7451 100644 --- a/SpanshRouter/SpanshRouter.py +++ b/SpanshRouter/SpanshRouter.py @@ -274,8 +274,11 @@ class SpanshRouter(): self.next_stop = self.route[self.offset][0] self.copy_waypoint() - except: + self.update_gui() + + except IOError: print("No previously saved route.") + except: exc_type, exc_value, exc_traceback = sys.exc_info() lines = traceback.format_exception(exc_type, exc_value, exc_traceback) sys.stderr.write(''.join('!! ' + line for line in lines)) diff --git a/load.py b/load.py index 81cc059..f5cbdfc 100644 --- a/load.py +++ b/load.py @@ -7,19 +7,18 @@ else: from SpanshRouter.SpanshRouter import SpanshRouter import tkinter.messagebox as confirmDialog +spansh_router = None + def plugin_start3(plugin_dir): global spansh_router spansh_router = SpanshRouter(plugin_dir) spansh_router.check_for_update() - spansh_router.open_last_route() return 'spansh_router' def plugin_start(plugin_dir): - # Check for newer versions global spansh_router spansh_router = SpanshRouter(plugin_dir) spansh_router.check_for_update() - spansh_router.open_last_route() return 'spansh_router' def plugin_stop(): @@ -54,4 +53,5 @@ def ask_for_update(): def plugin_app(parent): global spansh_router spansh_router.init_gui(parent) + spansh_router.open_last_route() parent.master.after_idle(ask_for_update)