mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +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:
parent
3384412632
commit
1d3ff006cd
@ -1,5 +1,11 @@
|
|||||||
#!/usr/bin/env python3
|
#!/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 csv
|
||||||
import json
|
import json
|
||||||
@ -210,6 +216,7 @@ if __name__ == "__main__":
|
|||||||
with open(file_name) as f:
|
with open(file_name) as f:
|
||||||
print(file_name)
|
print(file_name)
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
data = data['data']
|
||||||
|
|
||||||
if not data['commander'].get('docked'):
|
if not data['commander'].get('docked'):
|
||||||
print('Not docked!')
|
print('Not docked!')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user