nncli

NextCloud Notes Command Line Interface
git clone git://git.danielmoch.com/nncli.git
Log | Files | Refs | LICENSE

commit 93a48205e39300169d7d73c62fcc39056e3a1785
parent 3f72eb781c15d601f2cb63b2211fe575af826aa6
Author: Eric Davis <edavis@insanum.com>
Date:   Thu,  2 Apr 2015 08:43:05 -0700

workaround for panic that occurs during initial sync under gui when there are lots of notes on the account

Diffstat:
Msimplenote_cli/sncli.py | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/simplenote_cli/sncli.py b/simplenote_cli/sncli.py @@ -19,9 +19,11 @@ def __init__(self, do_server_sync, verbose=False): self.do_server_sync = do_server_sync self.verbose = verbose self.do_gui = False + force_full_sync = False if not os.path.exists(self.config.get_config('db_path')): os.mkdir(self.config.get_config('db_path')) + force_full_sync = True # configure the logging module self.logfile = os.path.join(self.config.get_config('db_path'), 'sncli.log') @@ -43,6 +45,16 @@ def __init__(self, do_server_sync, verbose=False): self.log(str(e)) sys.exit(1) + if force_full_sync: + # The note database doesn't exist so force a full sync. Itis + # important to do this outside of the gui because an account + # with hundreds of notes will cause a recursion panic under + # urwid. This simple workaround gets the job done. :-) + self.verbose = True + self.log(u'sncli database doesn\'t exist, forcing full sync...') + self.sync_notes() + self.verbose = verbose + def sync_notes(self): self.ndb.sync_now(self.do_server_sync)