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

collate.py: Correction so it works with dump/ files

And adjust the dile docstring to point out it will only work with the
dump/ file format, not the new 'File > Save Raw Data' one.
This commit is contained in:
Athanasius 2021-12-17 11:35:00 +00:00
parent 3384412632
commit 1d3ff006cd
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -1,5 +1,11 @@
#!/usr/bin/env python3
"""Collate lists of seen commodities, modules and ships from dumps of the Companion API output."""
"""
Collate lists of seen commodities, modules and ships from dumps of the Companion API output.
Note that currently this will only work with the output files created if you
run the main program from a working directory that has a `dump/` directory,
which causes a file to be written per CAPI query.
"""
import csv
import json
@ -210,6 +216,7 @@ if __name__ == "__main__":
with open(file_name) as f:
print(file_name)
data = json.load(f)
data = data['data']
if not data['commander'].get('docked'):
print('Not docked!')