From 094dde0e8cb6c34290abeb432efaa1cc8910dbf5 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Thu, 24 Oct 2019 15:47:21 +0200 Subject: [PATCH] fix: 'effective configuration' is a debug log now --- bin/pwnagotchi | 3 +++ pwnagotchi/utils.py | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/pwnagotchi b/bin/pwnagotchi index 6d1bd41..dd1b9b3 100755 --- a/bin/pwnagotchi +++ b/bin/pwnagotchi @@ -3,6 +3,7 @@ if __name__ == '__main__': import argparse import time import logging + import yaml import pwnagotchi import pwnagotchi.grid as grid @@ -34,6 +35,8 @@ if __name__ == '__main__': config = utils.load_config(args) utils.setup_logging(args, config) + logging.debug("effective configuration:\n\n%s\n\n" % yaml.dump(config, default_flow_style=False)) + plugins.load(config) display = Display(config=config, state={'name': '%s>' % pwnagotchi.name()}) diff --git a/pwnagotchi/utils.py b/pwnagotchi/utils.py index 4f3d10d..1c430f4 100644 --- a/pwnagotchi/utils.py +++ b/pwnagotchi/utils.py @@ -89,8 +89,6 @@ def load_config(args): print("unsupported display type %s" % config['ui']['display']['type']) exit(1) - print("Effective Configuration:") - print(yaml.dump(config, default_flow_style=False)) return config @@ -115,6 +113,7 @@ def setup_logging(args, config): requests_log.addHandler(logging.NullHandler()) requests_log.propagate = False + def secs_to_hhmmss(secs): mins, secs = divmod(secs, 60) hours, mins = divmod(mins, 60) @@ -272,7 +271,7 @@ class StatusFile(object): return self._updated is not None and ((datetime.now() - self._updated).seconds / 60) < minutes def newer_then_hours(self, hours): - return self._updated is not None and ((datetime.now() - self._updated).seconds / (60*60)) < hours + return self._updated is not None and ((datetime.now() - self._updated).seconds / (60 * 60)) < hours def newer_then_days(self, days): return self._updated is not None and (datetime.now() - self._updated).days < days