1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

Fixes generation of market CSV files

This commit is contained in:
Athanasius 2019-09-11 12:53:04 +01:00
parent 3117f7ca3e
commit 08e5b6ff6a
2 changed files with 2 additions and 2 deletions

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()

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'])