Fixes generation of market CSV files

This commit is contained in:
Athanasius committed 2019-09-26 11:40:41 +01:00
1 parent 3117f7ca3e
commit 08e5b6ff6a
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'])