From 637f58bb0692ad40496d3aef95b74f4f6ff90e14 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 07:47:51 +0200 Subject: [PATCH] Replaced modulo-formatting with .format --- EDMC.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/EDMC.py b/EDMC.py index d7b2c4d9..78f9da8d 100755 --- a/EDMC.py +++ b/EDMC.py @@ -107,7 +107,7 @@ try: monitor.parse_entry(line) except Exception: if __debug__: - print('Invalid journal entry "%s"' % repr(line)) + print('Invalid journal entry {!r}'.format(line)) except Exception as e: print("Can't read Journal file: {}".format(str(e)), file=sys.stderr) @@ -191,7 +191,7 @@ try: stats.export_status(data, args.t) if data['commander'].get('docked'): - print('%s,%s' % ( + print('{},{}'.format( deep_get(data, 'lastSystem', 'name', default='Unknown'), deep_get(data, 'lastStarport', 'name', default='Unknown') )) @@ -266,7 +266,7 @@ try: eddn_sender.export_shipyard(data, monitor.is_beta) except Exception as e: - print("Failed to send data to EDDN: %s" % unicode(e).encode('ascii', 'replace'), file=sys.stderr) + print("Failed to send data to EDDN: {}".format(str(e)), file=sys.stderr) sys.exit(EXIT_SUCCESS)