nncli

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

commit 8d525b28e5906b7c01954ea0a8e99fec881a9499
parent 399379685c5c70e44b6604188956e05e2bc93f80
Author: Eric Davis <edavis@insanum.com>
Date:   Tue,  8 Jul 2014 23:48:20 -0700

new config for max_logs

Diffstat:
Mconfig.py | 2++
Msncli.py | 3+--
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/config.py b/config.py @@ -20,6 +20,7 @@ def __init__(self): 'cfg_status_bar' : 'yes', 'cfg_editor' : 'vim', 'cfg_pager' : 'less -c', + 'cfg_max_logs' : '5', 'cfg_log_reversed' : 'yes', 'kb_help' : 'h', @@ -119,6 +120,7 @@ def __init__(self): 'status_bar' : [ cp.get(cfg_sec, 'cfg_status_bar'), 'Status bar location' ], 'editor' : [ cp.get(cfg_sec, 'cfg_editor'), 'Editor' ], 'pager' : [ cp.get(cfg_sec, 'cfg_pager'), 'External pager' ], + 'max_logs' : [ cp.get(cfg_sec, 'cfg_max_logs'), 'Max logs in footer' ], 'log_reversed' : [ cp.get(cfg_sec, 'cfg_log_reversed'), 'Log file reversed' ] } diff --git a/sncli.py b/sncli.py @@ -31,7 +31,6 @@ def __init__(self): logging.debug('sncli logging initialized') - self.max_logs = 5 self.logs = [] try: @@ -124,7 +123,7 @@ def log(self, msg): self.log_lock.acquire() self.logs.append(msg) - if len(self.logs) > self.max_logs: + if len(self.logs) > self.config.get_config('max_logs'): self.logs.pop(0) p = urwid.Pile([])