Fixes generation of market CSV files

This commit is contained in:
Athanasius committed 2020-06-21 16:23:00 +01:00
1 parent a25d22123b
commit ee588e2f1f
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -55,6 +55,6 @@ def export(data, kind=COMMODITY_DEFAULT, filename=None):
line = sep.join([line, str(int(commodity['meanPrice'])), str(commodity['id']), data['timestamp'] + '\n'])
else:
line = sep.join([line, data['timestamp'] + '\n'])
h.write(line.encode('utf-8'))
h.write(line)
h.close()
+1 -1
View File
@@ -447,7 +447,7 @@ def fixup(data):
if not commodity_map:
# Lazily populate
for f in ['commodity.csv', 'rare_commodity.csv']:
with open(join(config.respath, f), 'rb') as csvfile:
with open(join(config.respath, f), 'r') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
commodity_map[row['symbol']] = (row['category'], row['name'])