nncli

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

commit 1e15a2bbd7573a1191ffb10423f86ca50d2985fd
parent aed8b6c45bf8fef592b6b1a70129170eb468ee38
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri,  8 Mar 2019 11:28:48 -0500

Fix view_log bug

The ViewLog class expected the logfile to exist in the config class, but
it lives in the logger class. So pass them both into the ViewLog class
when it's instantiated.

Diffstat:
Mnncli/gui.py | 2+-
Mnncli/view_log.py | 5+++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/nncli/gui.py b/nncli/gui.py @@ -50,7 +50,7 @@ def __init__(self, config, logger, ndb, key=None): } ) - self.view_log = view_log.ViewLog(self.config) + self.view_log = view_log.ViewLog(self.config, self.logger) self.view_help = view_help.ViewHelp(self.config) palette = \ diff --git a/nncli/view_log.py b/nncli/view_log.py @@ -8,14 +8,15 @@ class ViewLog(urwid.ListBox): This class defines the urwid view class for the log viewer """ - def __init__(self, config): + def __init__(self, config, logger): self.config = config + self.logger = logger super(ViewLog, self).__init__(urwid.SimpleFocusListWalker([])) def update_log(self): """update the log""" lines = [] - with open(self.config.logfile) as logfile: + with open(self.logger.logfile) as logfile: for line in logfile: lines.append( urwid.AttrMap(urwid.Text(line.rstrip()),