|
@@ -27,7 +27,7 @@ def main() -> None:
|
|
|
planets = [Planet(fio_burn) for fio_burn in get_fio_burn(args.planets)]
|
|
planets = [Planet(fio_burn) for fio_burn in get_fio_burn(args.planets)]
|
|
|
if args.include_ship:
|
|
if args.include_ship:
|
|
|
stores: typing.Sequence[market.Storage] = cache.get('https://rest.fnar.net/storage/' + config.username,
|
|
stores: typing.Sequence[market.Storage] = cache.get('https://rest.fnar.net/storage/' + config.username,
|
|
|
- headers={'Authorization': config.fio_api_key})
|
|
|
|
|
|
|
+ headers={'Authorization': config.fio_rest_key})
|
|
|
for ship in args.include_ship:
|
|
for ship in args.include_ship:
|
|
|
ship_name, planet_name = ship.casefold().split('=')
|
|
ship_name, planet_name = ship.casefold().split('=')
|
|
|
for store in stores:
|
|
for store in stores:
|
|
@@ -88,7 +88,7 @@ def main() -> None:
|
|
|
|
|
|
|
|
def get_fio_burn(planet_names: typing.Sequence[str]) -> typing.Iterator[FIOBurn]:
|
|
def get_fio_burn(planet_names: typing.Sequence[str]) -> typing.Iterator[FIOBurn]:
|
|
|
planets: list[FIOBurn] = cache.get('https://rest.fnar.net/fioweb/burn/user/' + config.username,
|
|
planets: list[FIOBurn] = cache.get('https://rest.fnar.net/fioweb/burn/user/' + config.username,
|
|
|
- headers={'Authorization': config.fio_api_key})
|
|
|
|
|
|
|
+ headers={'Authorization': config.fio_rest_key})
|
|
|
for name in planet_names:
|
|
for name in planet_names:
|
|
|
name = name.casefold()
|
|
name = name.casefold()
|
|
|
for planet_data in planets:
|
|
for planet_data in planets:
|
|
@@ -195,11 +195,11 @@ def shipping_used(materials: typing.Mapping[str, Material], ignore: typing.Colle
|
|
|
|
|
|
|
|
def warehouse_inventory() -> dict[str, int]:
|
|
def warehouse_inventory() -> dict[str, int]:
|
|
|
warehouses: typing.Sequence[market.Warehouse] = cache.get('https://rest.fnar.net/sites/warehouses/' + config.username,
|
|
warehouses: typing.Sequence[market.Warehouse] = cache.get('https://rest.fnar.net/sites/warehouses/' + config.username,
|
|
|
- headers={'Authorization': config.fio_api_key})
|
|
|
|
|
|
|
+ headers={'Authorization': config.fio_rest_key})
|
|
|
for warehouse in warehouses:
|
|
for warehouse in warehouses:
|
|
|
if warehouse['LocationNaturalId'] == 'HRT':
|
|
if warehouse['LocationNaturalId'] == 'HRT':
|
|
|
storage: market.Storage = cache.get(f'https://rest.fnar.net/storage/{config.username}/{warehouse["StoreId"]}',
|
|
storage: market.Storage = cache.get(f'https://rest.fnar.net/storage/{config.username}/{warehouse["StoreId"]}',
|
|
|
- headers={'Authorization': config.fio_api_key})
|
|
|
|
|
|
|
+ headers={'Authorization': config.fio_rest_key})
|
|
|
assert storage['Type'] == 'WAREHOUSE_STORE'
|
|
assert storage['Type'] == 'WAREHOUSE_STORE'
|
|
|
return {item['MaterialTicker']: item['MaterialAmount'] for item in storage['StorageItems']}
|
|
return {item['MaterialTicker']: item['MaterialAmount'] for item in storage['StorageItems']}
|
|
|
raise Exception("couldn't find HRT warehouse")
|
|
raise Exception("couldn't find HRT warehouse")
|