nncli

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

commit 364da5b17c4d5b9eecdc6200a613b65018d583f9
parent 2b079569276349951f56ec5d0a7445bba465e71c
Author: Eric Davis <edavis@insanum.com>
Date:   Mon, 14 Jul 2014 00:24:46 -0700

show version in note status output

Diffstat:
Msncli.py | 29+++++++++++++++--------------
Mview_note.py | 12++++++++++--
2 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/sncli.py b/sncli.py @@ -754,15 +754,6 @@ def cli_list_notes(self, regex, search_string): u' [' + flags + u'] ' + \ utils.get_note_title(n.note) - def cli_dump_notes(self, regex, search_string): - - note_list, match_regex, all_notes_cnt = \ - self.ndb.filter_notes( - search_string, - search_mode='regex' if regex else 'gstyle') - for n in note_list: - self.cli_note_dump(n.key) - def cli_note_dump(self, key): note = self.ndb.get_note(key) @@ -779,14 +770,24 @@ def cli_note_dump(self, key): tags = utils.get_note_tags(note) print sep - print (u'| {:<' + str(w) + u'} |').format((u'Title: ' + title)[:w]) - print (u'| {:<' + str(w) + u'} |').format((u' Key: ' + note['key'])[:w]) - print (u'| {:<' + str(w) + u'} |').format((u' Date: ' + mod_time)[:w]) - print (u'| {:<' + str(w) + u'} |').format((u' Tags: ' + tags)[:w]) - print (u'| {:<' + str(w) + u'} |').format((u'Flags: [' + flags + u']')[:w]) + print (u'| {:<' + str(w) + u'} |').format((u' Title: ' + title)[:w]) + print (u'| {:<' + str(w) + u'} |').format((u' Key: ' + note['key'])[:w]) + print (u'| {:<' + str(w) + u'} |').format((u' Date: ' + mod_time)[:w]) + print (u'| {:<' + str(w) + u'} |').format((u' Tags: ' + tags)[:w]) + print (u'| {:<' + str(w) + u'} |').format((u'Version: v' + str(note['version']))[:w]) + print (u'| {:<' + str(w) + u'} |').format((u' Flags: [' + flags + u']')[:w]) print sep print note['content'] + def cli_dump_notes(self, regex, search_string): + + note_list, match_regex, all_notes_cnt = \ + self.ndb.filter_notes( + search_string, + search_mode='regex' if regex else 'gstyle') + for n in note_list: + self.cli_note_dump(n.key) + def cli_note_create(self, from_stdin, title): if from_stdin: diff --git a/view_note.py b/view_note.py @@ -56,7 +56,9 @@ def get_status_bar(self): wrap='clip'), 'status_bar') status_key_index = \ - ('pack', urwid.AttrMap(urwid.Text(u' [' + self.note['key'] + u'] ' + + ('pack', urwid.AttrMap(urwid.Text(u' [' + + self.note['key'] + + u'] ' + str(cur + 1) + u'/' + str(total)), @@ -66,7 +68,13 @@ def get_status_bar(self): wrap='clip'), 'status_bar') status_tags_flags = \ - ('pack', urwid.AttrMap(urwid.Text(u'[' + tags + u'] [' + flags + u']'), + ('pack', urwid.AttrMap(urwid.Text(u'[' + + tags + + u'] [v' + + str(self.note['version']) + + u'] [' + + flags + + u']'), 'status_bar')) pile_top = urwid.Columns([ status_title, status_key_index ]) pile_bottom = urwid.Columns([ status_date, status_tags_flags ])