commit 2b9a20dffeddbb02298838ca46b3da774a6a806d parent 41d0d01853face2828fd51515f08257d74bb15c4 Author: Shawn Axsom <shawn.axsom@rooksecurity.com> Date: Tue, 26 May 2015 08:51:49 -0400 Allow sncli to always exit if working offline, instead of trying to wait for notes to sync. Urllib2.urlopen() doesn't seem to want to time out, even with timeout=3 and setticking socket default timeout options. Diffstat:
M | simplenote_cli/sncli.py | | | 18 | ++++++++++++------ |
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/simplenote_cli/sncli.py b/simplenote_cli/sncli.py @@ -885,12 +885,18 @@ def gui_reset(self): def gui_stop(self): # don't exit if there are any notes not yet saved to the disk - if self.ndb.verify_all_saved(): - # clear the screen and exit the urwid run loop - self.gui_clear() - raise urwid.ExitMainLoop() - else: - self.log(u'WARNING: Not all notes saved to disk (wait for sync worker)') + + # TODO - verify_all_saved() was deadlocking for me. urllib2.urlopen() isn't timing out appropriately if connection is down. + # if self.ndb.verify_all_saved(): + # # clear the screen and exit the urwid run loop + # self.gui_clear() + # raise urwid.ExitMainLoop() + # else: + # self.log(u'WARNING: Not all notes saved to disk (wait for sync worker)') + + # clear the screen and exit the urwid run loop + self.gui_clear() + raise urwid.ExitMainLoop() def gui(self, key):