nncli

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

commit 5f46de926d640c6b6a5e95920462fb462d7c141f
parent a18bce32c9743623a51b885fbaddfbf306c6f6ce
Author: Shawn Axsom <shawn.axsom@rooksecurity.com>
Date:   Sun,  8 Mar 2015 15:12:58 -0400

Minor cleanup

Diffstat:
Msimplenote_cli/config.py | 8+++-----
Msimplenote_cli/sncli.py | 5++---
Msimplenote_cli/view_note.py | 20++++++++++----------
3 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/simplenote_cli/config.py b/simplenote_cli/config.py @@ -21,8 +21,7 @@ def __init__(self): 'cfg_format_note_title' : '[%D] %F %-N %T', 'cfg_status_bar' : 'yes', 'cfg_editor' : 'vim', - # 'cfg_pager' : 'less -c', - 'cfg_pager' : 'vim -R', + 'cfg_pager' : 'less -c', 'cfg_diff' : 'diff -b -U10', 'cfg_max_logs' : '5', 'cfg_log_timeout' : '5', @@ -42,9 +41,8 @@ def __init__(self): 'kb_status' : 's', 'kb_create_note' : 'C', 'kb_edit_note' : 'e', - # TODO - update this 'kb_view_note' : 'enter', - 'kb_view_note_ext' : 'a', + 'kb_view_note_ext' : 'meta enter', 'kb_view_note_json' : 'O', 'kb_pipe_note' : '|', 'kb_view_next_note' : 'J', @@ -181,7 +179,7 @@ def __init__(self): self.keybinds['search_gstyle'] = [ cp.get(cfg_sec, 'kb_search_gstyle'), [ 'titles', 'notes' ], 'Search using gstyle' ] self.keybinds['search_prev_gstyle'] = [ cp.get(cfg_sec, 'kb_search_prev_gstyle'), [ 'notes' ], 'Search backwards using gstyle' ] self.keybinds['search_regex'] = [ cp.get(cfg_sec, 'kb_search_regex'), [ 'titles', 'notes' ], 'Search using regex' ] - self.keybinds['search_prev_regex'] = [ cp.get(cfg_sec, 'kb_search_prev_regex'), [ 'titles', 'notes' ], 'Search using regex' ] + self.keybinds['search_prev_regex'] = [ cp.get(cfg_sec, 'kb_search_prev_regex'), [ 'notes' ], 'Search backwards using regex' ] self.keybinds['search_next'] = [ cp.get(cfg_sec, 'kb_search_next'), [ 'notes' ], 'Go to next search result' ] self.keybinds['search_prev'] = [ cp.get(cfg_sec, 'kb_search_prev'), [ 'notes' ], 'Go to previous search result' ] self.keybinds['clear_search'] = [ cp.get(cfg_sec, 'kb_clear_search'), [ 'titles' ], 'Show all notes' ] diff --git a/simplenote_cli/sncli.py b/simplenote_cli/sncli.py @@ -11,7 +11,6 @@ from simplenote import Simplenote from notes_db import NotesDB, ReadError, WriteError from logging.handlers import RotatingFileHandler -import pdb class sncli: @@ -112,7 +111,7 @@ def exec_diff_on_note(self, note, old_note): out = temp.tempfile_create(None) try: - subprocess.call(diff + u' ' + + subprocess.call(diff + u' ' + temp.tempfile_name(ltf) + u' ' + temp.tempfile_name(otf) + u' > ' + temp.tempfile_name(out), @@ -866,7 +865,7 @@ def gui_stop(self): self.gui_clear() raise urwid.ExitMainLoop() else: - self.log(u'WARNING: Not all notes saved to disk (wait for sync worker)') + self.log(u'WARNING: Not all notes saved to disk (wait for sync worker)') def gui(self, key): diff --git a/simplenote_cli/view_note.py b/simplenote_cli/view_note.py @@ -148,8 +148,8 @@ def get_status_bar(self): 'status_bar') status_key_index = \ - ('pack', urwid.AttrMap(urwid.Text(u' [' + - self.key + + ('pack', urwid.AttrMap(urwid.Text(u' [' + + self.key + u'] ' + str(cur + 1) + u'/' + @@ -163,18 +163,18 @@ def get_status_bar(self): if self.old_note: status_tags_flags = \ - ('pack', urwid.AttrMap(urwid.Text(u'[OLD:v' + - str(version) + + ('pack', urwid.AttrMap(urwid.Text(u'[OLD:v' + + str(version) + u']'), 'status_bar')) else: status_tags_flags = \ - ('pack', urwid.AttrMap(urwid.Text(u'[' + - tags + - u'] [v' + - str(version) + - u'] [' + - flags + + ('pack', urwid.AttrMap(urwid.Text(u'[' + + tags + + u'] [v' + + str(version) + + u'] [' + + flags + u']'), 'status_bar'))