nncli

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

commit 25eb093fc8f2aec1a927194b527ddf190cc804d3
parent 9936dd7a2397df1df67da8444d6e7f2e151675db
Author: Eric Davis <edavis@insanum.com>
Date:   Mon, 14 Jul 2014 11:23:09 -0700

update view after creating a new note and trashing/untrashing an existing note

Diffstat:
Msncli.py | 4++++
Mview_titles.py | 3++-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/sncli.py b/sncli.py @@ -412,6 +412,7 @@ def gui_frame_keypress(self, size, key): if content and content != u'\n': self.log(u'New note created') self.ndb.create_note(content) + self.gui_update_view() elif key == self.config.get_keybind('edit_note') or \ key == self.config.get_keybind('view_note_ext'): @@ -494,6 +495,9 @@ def gui_frame_keypress(self, size, key): self.ndb.set_note_deleted(note['key'], 1 if not note['deleted'] else 0) + if self.gui_body_get().__class__ == view_titles.ViewTitles: + lb.update_note_title(None) + elif key == self.config.get_keybind('note_pin'): if self.gui_body_get().__class__ != view_titles.ViewTitles and \ self.gui_body_get().__class__ != view_note.ViewNote: diff --git a/view_titles.py b/view_titles.py @@ -176,7 +176,8 @@ def update_note_title(self, key): def focus_note(self, key): for i in xrange(len(self.note_list)): - if self.note_list[i].note['key'] == key: + if 'key' in self.note_list[i].note and \ + self.note_list[i].note['key'] == key: self.focus_position = i def keypress(self, size, key):