nncli

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

commit 25b40d5709e79894dd0619c87d1aa8a409a75315
parent 980fdc1ad8b6bf15073aebac247f681d3fb16c3b
Author: Eric Davis <edavis@insanum.com>
Date:   Wed, 16 Jul 2014 10:58:49 -0700

use old note content with external pager, raw json, and pipe commands

Diffstat:
Msncli.py | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/sncli.py b/sncli.py @@ -350,7 +350,11 @@ def gui_pipe_input(self, args, cmd): self.gui_body_focus() self.master_frame.keypress = self.gui_frame_keypress if cmd != None: - note = self.view_titles.note_list[self.view_titles.focus_position].note + if self.gui_body_get().__class__ == view_titles.ViewTitles: + note = self.view_titles.note_list[self.view_titles.focus_position].note + else: # self.gui_body_get().__class__ == view_note.ViewNote: + note = self.view_note.old_note if self.view_note.old_note \ + else self.view_note.note args = shlex.split(cmd) try: self.gui_clear() @@ -589,7 +593,10 @@ def gui_frame_keypress(self, size, key): return None note = lb.note_list[lb.focus_position].note else: # self.gui_body_get().__class__ == view_note.ViewNote: - note = lb.note + if key == self.config.get_keybind('edit_note'): + note = lb.note + else: + note = lb.old_note if lb.old_note else lb.note self.gui_clear() if key == self.config.get_keybind('edit_note'): @@ -637,7 +644,7 @@ def gui_frame_keypress(self, size, key): return None note = lb.note_list[lb.focus_position].note else: # self.gui_body_get().__class__ == view_note.ViewNote: - note = lb.note + note = lb.old_note if lb.old_note else lb.note self.gui_footer_input_set( urwid.AttrMap(