From 9b183398908777535d3cf5d8aa94d1cc0c6ea5ce Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 31 Jan 2018 16:17:55 +0100 Subject: [PATCH] kete: remove pointless indirection class Printer In this case, it's easier to just iterate in the do_list() call than having a Worker element --- tools/tuhi-kete.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tools/tuhi-kete.py b/tools/tuhi-kete.py index f68e0d4..cbd5745 100755 --- a/tools/tuhi-kete.py +++ b/tools/tuhi-kete.py @@ -503,13 +503,6 @@ class Fetcher(Worker): svg.save() -class Printer(Worker): - def run(self): - logger.debug('Listing available devices:') - for d in self.manager.devices: - print(d) - - class TuhiKeteShellLogHandler(logging.StreamHandler): def __init__(self): super(TuhiKeteShellLogHandler, self).__init__(sys.stdout) @@ -596,7 +589,9 @@ class TuhiKeteShell(cmd.Cmd): def do_list(self, arg): '''List known devices. These are devices previously paired with the daemon.''' - self.start_worker(Printer) + logger.debug('Listing available devices:') + for d in self._manager.devices: + print(d) def help_listen(self): self.do_listen('-h')