nncli

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

commit 135ad6914de23c5e3cd30398849454df18d34f9f
parent e6a26e01c5564705826a02411bea2d42280110af
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri,  9 Nov 2018 19:34:26 -0500

Fix sync CLI command

Diffstat:
Mnncli/cli.py | 2+-
Mnncli/notes_db.py | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/nncli/cli.py b/nncli/cli.py @@ -227,7 +227,7 @@ def main(ctx, nosync, verbose, config, key): if ctx.invoked_subcommand is None: ctx.obj.gui(key) elif not nosync: - ctx.obj.sync_notes() + ctx.obj.ndb.sync_notes() main.add_command(create) main.add_command(edit) diff --git a/nncli/notes_db.py b/nncli/notes_db.py @@ -430,7 +430,7 @@ def _helper_save_note(self, k, note): # record that we saved this to disc. note['savedate'] = int(time.time()) - def _sync_notes(self, server_sync=True, full_sync=True): + def sync_notes(self, server_sync=True, full_sync=True): """Perform a full bi-directional sync with server. Psuedo-code algorithm for syncing: @@ -685,7 +685,7 @@ def verify_all_saved(self): def sync_now(self, do_server_sync=True): """Sync the notes to the server""" self.sync_lock.acquire() - self._sync_notes(server_sync=do_server_sync, + self.sync_notes(server_sync=do_server_sync, full_sync=True if not self.last_sync else False) self.sync_lock.release()