nncli

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

commit c1bda40e9bf6c0a797f46ed8d755d0dd896a3fa3
parent 34adc95511d190fc9fe1691bd48203cd8a938f7d
Author: Eric Davis <edavis@insanum.com>
Date:   Sun,  6 Jul 2014 14:50:26 -0700

fixed help to allow keybinds to be used in multiple views

Diffstat:
Mconfig.py | 52++++++++++++++++++++++++++--------------------------
Mview_help.py | 2+-
2 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/config.py b/config.py @@ -117,32 +117,32 @@ def __init__(self): self.keybinds = \ { - 'help' : [ cp.get(cfg_sec, 'kb_help'), 'common', 'Help' ], - 'quit' : [ cp.get(cfg_sec, 'kb_quit'), 'common', 'Quit' ], - 'down' : [ cp.get(cfg_sec, 'kb_down'), 'common', 'Scroll down one line' ], - 'up' : [ cp.get(cfg_sec, 'kb_up'), 'common', 'Scroll up one line' ], - 'page_down' : [ cp.get(cfg_sec, 'kb_page_down'), 'common', 'Page down' ], - 'page_up' : [ cp.get(cfg_sec, 'kb_page_up'), 'common', 'Page up' ], - 'half_page_down' : [ cp.get(cfg_sec, 'kb_half_page_down'), 'common', 'Half page down' ], - 'half_page_up' : [ cp.get(cfg_sec, 'kb_half_page_up'), 'common', 'Half page up' ], - 'bottom' : [ cp.get(cfg_sec, 'kb_bottom'), 'common', 'Goto bottom' ], - 'top' : [ cp.get(cfg_sec, 'kb_top'), 'common', 'Goto top' ], - 'status' : [ cp.get(cfg_sec, 'kb_status'), 'common', 'Toggle status bar' ], - 'view_log' : [ cp.get(cfg_sec, 'kb_view_log'), 'common', 'View log' ], - 'view_note' : [ cp.get(cfg_sec, 'kb_view_note'), 'titles', 'View note' ], - 'view_note_ext' : [ cp.get(cfg_sec, 'kb_view_note_ext'), 'titles', 'View note with pager' ], - 'view_next_note' : [ cp.get(cfg_sec, 'kb_view_next_note'), 'notes', 'View next note' ], - 'view_prev_note' : [ cp.get(cfg_sec, 'kb_view_prev_note'), 'notes', 'View previous note' ], - 'tabstop2' : [ cp.get(cfg_sec, 'kb_tabstop2'), 'notes', 'View with tabstop=2' ], - 'tabstop4' : [ cp.get(cfg_sec, 'kb_tabstop4'), 'notes', 'View with tabstop=4' ], - 'tabstop8' : [ cp.get(cfg_sec, 'kb_tabstop8'), 'notes', 'View with tabstop=8' ], - 'search' : [ cp.get(cfg_sec, 'kb_search'), 'titles', 'Search notes' ], - 'clear_search' : [ cp.get(cfg_sec, 'kb_clear_search'), 'titles', 'Show all notes' ], - 'note_pin' : [ cp.get(cfg_sec, 'kb_note_pin'), 'titles', 'Pin note' ], - 'note_unpin' : [ cp.get(cfg_sec, 'kb_note_unpin'), 'titles', 'Unpin note' ], - 'note_markdown' : [ cp.get(cfg_sec, 'kb_note_markdown'), 'titles', 'Flag note as markdown' ], - 'note_unmarkdown' : [ cp.get(cfg_sec, 'kb_note_unmarkdown'), 'titles', 'Unflag note as markdown' ], - 'note_tags' : [ cp.get(cfg_sec, 'kb_note_tags'), 'titles', 'Edit note tags' ] + 'help' : [ cp.get(cfg_sec, 'kb_help'), [ 'common' ], 'Help' ], + 'quit' : [ cp.get(cfg_sec, 'kb_quit'), [ 'common' ], 'Quit' ], + 'down' : [ cp.get(cfg_sec, 'kb_down'), [ 'common' ], 'Scroll down one line' ], + 'up' : [ cp.get(cfg_sec, 'kb_up'), [ 'common' ], 'Scroll up one line' ], + 'page_down' : [ cp.get(cfg_sec, 'kb_page_down'), [ 'common' ], 'Page down' ], + 'page_up' : [ cp.get(cfg_sec, 'kb_page_up'), [ 'common' ], 'Page up' ], + 'half_page_down' : [ cp.get(cfg_sec, 'kb_half_page_down'), [ 'common' ], 'Half page down' ], + 'half_page_up' : [ cp.get(cfg_sec, 'kb_half_page_up'), [ 'common' ], 'Half page up' ], + 'bottom' : [ cp.get(cfg_sec, 'kb_bottom'), [ 'common' ], 'Goto bottom' ], + 'top' : [ cp.get(cfg_sec, 'kb_top'), [ 'common' ], 'Goto top' ], + 'status' : [ cp.get(cfg_sec, 'kb_status'), [ 'common' ], 'Toggle status bar' ], + 'view_log' : [ cp.get(cfg_sec, 'kb_view_log'), [ 'common' ], 'View log' ], + 'view_note' : [ cp.get(cfg_sec, 'kb_view_note'), [ 'titles' ], 'View note' ], + 'view_note_ext' : [ cp.get(cfg_sec, 'kb_view_note_ext'), [ 'titles' ], 'View note with pager' ], + 'view_next_note' : [ cp.get(cfg_sec, 'kb_view_next_note'), [ 'notes' ], 'View next note' ], + 'view_prev_note' : [ cp.get(cfg_sec, 'kb_view_prev_note'), [ 'notes' ], 'View previous note' ], + 'tabstop2' : [ cp.get(cfg_sec, 'kb_tabstop2'), [ 'notes' ], 'View with tabstop=2' ], + 'tabstop4' : [ cp.get(cfg_sec, 'kb_tabstop4'), [ 'notes' ], 'View with tabstop=4' ], + 'tabstop8' : [ cp.get(cfg_sec, 'kb_tabstop8'), [ 'notes' ], 'View with tabstop=8' ], + 'search' : [ cp.get(cfg_sec, 'kb_search'), [ 'titles' ], 'Search notes' ], + 'clear_search' : [ cp.get(cfg_sec, 'kb_clear_search'), [ 'titles' ], 'Show all notes' ], + 'note_pin' : [ cp.get(cfg_sec, 'kb_note_pin'), [ 'titles' ], 'Pin note' ], + 'note_unpin' : [ cp.get(cfg_sec, 'kb_note_unpin'), [ 'titles' ], 'Unpin note' ], + 'note_markdown' : [ cp.get(cfg_sec, 'kb_note_markdown'), [ 'titles' ], 'Flag note as markdown' ], + 'note_unmarkdown' : [ cp.get(cfg_sec, 'kb_note_unmarkdown'), [ 'titles' ], 'Unflag note as markdown' ], + 'note_tags' : [ cp.get(cfg_sec, 'kb_note_tags'), [ 'titles' ], 'Edit note tags' ] } self.colors = \ diff --git a/view_help.py b/view_help.py @@ -45,7 +45,7 @@ def create_kb_help_lines(self, header, use): 'help_header', 'help_focus')) for c in self.config.keybinds.keys(): - if self.config.get_keybind_use(c) != use: + if use not in self.config.get_keybind_use(c): continue lines.append( urwid.AttrMap(