From ddf2babaaac6ea1d80f7645f6cce8e6f2250f3f3 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 18 Sep 2019 15:09:22 +0100 Subject: [PATCH] Fixes up "EDMC.py -j" for python3 --- EDMC.py | 2 +- collate.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/EDMC.py b/EDMC.py index 989b05b6..66266f2b 100755 --- a/EDMC.py +++ b/EDMC.py @@ -78,7 +78,7 @@ try: if args.j: # Import and collate from JSON dump data = json.load(open(args.j)) - config.set('querytime', getmtime(args.j)) + config.set('querytime', int(getmtime(args.j))) else: # Get state from latest Journal file try: diff --git a/collate.py b/collate.py index c1657ead..49cb724b 100755 --- a/collate.py +++ b/collate.py @@ -129,7 +129,7 @@ def addships(data): ships[int(row['id'])] = row # index by int for easier lookup and sorting size_pre = len(ships) - for ship in (data['lastStarport']['ships'].get('shipyard_list') or {}).values() + data['lastStarport']['ships'].get('unavailable_list'): + for ship in list((data['lastStarport']['ships'].get('shipyard_list') or {}).values()) + data['lastStarport']['ships'].get('unavailable_list'): # sanity check key = ship['id'] new = { 'id': int(key), 'symbol': ship['name'], 'name': companion.ship_map.get(ship['name'].lower()) } @@ -152,7 +152,7 @@ def addships(data): os.unlink(shipfile+'.bak') os.rename(shipfile, shipfile+'.bak') - with open(shipfile, 'wb') as csvfile: + with open(shipfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, ['id', 'symbol', 'name']) writer.writeheader() for key in sorted(ships):