mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
new: new --skip-session for manual mode to skip session parsing
This commit is contained in:
@ -21,6 +21,9 @@ if __name__ == '__main__':
|
|||||||
help='If this file exists, configuration will be merged and this will override default values.')
|
help='If this file exists, configuration will be merged and this will override default values.')
|
||||||
|
|
||||||
parser.add_argument('--manual', dest="do_manual", action="store_true", default=False, help="Manual mode.")
|
parser.add_argument('--manual', dest="do_manual", action="store_true", default=False, help="Manual mode.")
|
||||||
|
parser.add_argument('--skip-session', dest="skip_session", action="store_true", default=False,
|
||||||
|
help="Skip last session parsing in manual mode.")
|
||||||
|
|
||||||
parser.add_argument('--clear', dest="do_clear", action="store_true", default=False,
|
parser.add_argument('--clear', dest="do_clear", action="store_true", default=False,
|
||||||
help="Clear the ePaper display and exit.")
|
help="Clear the ePaper display and exit.")
|
||||||
|
|
||||||
@ -49,8 +52,8 @@ if __name__ == '__main__':
|
|||||||
elif args.do_manual:
|
elif args.do_manual:
|
||||||
logging.info("entering manual mode ...")
|
logging.info("entering manual mode ...")
|
||||||
|
|
||||||
agent.last_session.parse()
|
agent.last_session.parse(args.skip_session)
|
||||||
|
if not args.skip_session:
|
||||||
logging.info(
|
logging.info(
|
||||||
"the last session lasted %s (%d completed epochs, trained for %d), average reward:%s (min:%s max:%s)" % (
|
"the last session lasted %s (%d completed epochs, trained for %d), average reward:%s (min:%s max:%s)" % (
|
||||||
agent.last_session.duration_human,
|
agent.last_session.duration_human,
|
||||||
|
@ -167,7 +167,10 @@ class LastSession(object):
|
|||||||
self.duration_human = ', '.join(self.duration_human)
|
self.duration_human = ', '.join(self.duration_human)
|
||||||
self.avg_reward /= (self.epochs if self.epochs else 1)
|
self.avg_reward /= (self.epochs if self.epochs else 1)
|
||||||
|
|
||||||
def parse(self):
|
def parse(self, skip=False):
|
||||||
|
if skip:
|
||||||
|
logging.debug("skipping parsing of the last session logs ...")
|
||||||
|
else:
|
||||||
logging.debug("parsing last session logs ...")
|
logging.debug("parsing last session logs ...")
|
||||||
|
|
||||||
lines = []
|
lines = []
|
||||||
|
Reference in New Issue
Block a user