fix: 'effective configuration' is a debug log now
This commit is contained in:
parent
dc5a626bd5
commit
094dde0e8c
@ -3,6 +3,7 @@ if __name__ == '__main__':
|
|||||||
import argparse
|
import argparse
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
|
import yaml
|
||||||
|
|
||||||
import pwnagotchi
|
import pwnagotchi
|
||||||
import pwnagotchi.grid as grid
|
import pwnagotchi.grid as grid
|
||||||
@ -34,6 +35,8 @@ if __name__ == '__main__':
|
|||||||
config = utils.load_config(args)
|
config = utils.load_config(args)
|
||||||
utils.setup_logging(args, config)
|
utils.setup_logging(args, config)
|
||||||
|
|
||||||
|
logging.debug("effective configuration:\n\n%s\n\n" % yaml.dump(config, default_flow_style=False))
|
||||||
|
|
||||||
plugins.load(config)
|
plugins.load(config)
|
||||||
|
|
||||||
display = Display(config=config, state={'name': '%s>' % pwnagotchi.name()})
|
display = Display(config=config, state={'name': '%s>' % pwnagotchi.name()})
|
||||||
|
@ -89,8 +89,6 @@ def load_config(args):
|
|||||||
print("unsupported display type %s" % config['ui']['display']['type'])
|
print("unsupported display type %s" % config['ui']['display']['type'])
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
print("Effective Configuration:")
|
|
||||||
print(yaml.dump(config, default_flow_style=False))
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
@ -115,6 +113,7 @@ def setup_logging(args, config):
|
|||||||
requests_log.addHandler(logging.NullHandler())
|
requests_log.addHandler(logging.NullHandler())
|
||||||
requests_log.propagate = False
|
requests_log.propagate = False
|
||||||
|
|
||||||
|
|
||||||
def secs_to_hhmmss(secs):
|
def secs_to_hhmmss(secs):
|
||||||
mins, secs = divmod(secs, 60)
|
mins, secs = divmod(secs, 60)
|
||||||
hours, mins = divmod(mins, 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
|
return self._updated is not None and ((datetime.now() - self._updated).seconds / 60) < minutes
|
||||||
|
|
||||||
def newer_then_hours(self, hours):
|
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):
|
def newer_then_days(self, days):
|
||||||
return self._updated is not None and (datetime.now() - self._updated).days < days
|
return self._updated is not None and (datetime.now() - self._updated).days < days
|
||||||
|
Loading…
x
Reference in New Issue
Block a user