|
|
@@ -1,5 +1,6 @@
|
|
|
from __future__ import annotations
|
|
|
|
|
|
+import datetime
|
|
|
import sys
|
|
|
import typing
|
|
|
|
|
|
@@ -15,10 +16,12 @@ def main() -> None:
|
|
|
|
|
|
infras: typing.Sequence[Infrastructure] = cache.get(
|
|
|
'https://api.fnar.net/infrastructure?include_contributions=true&infrastructure=' + planet)
|
|
|
+ threshold = (datetime.datetime.now(datetime.UTC) - datetime.timedelta(days=60)).strftime('%Y-%m-%d')
|
|
|
for infra in infras:
|
|
|
print(infra['Type'])
|
|
|
+ infra['Contributions'].sort(key=lambda c: c['Time'])
|
|
|
for contribution in infra['Contributions']:
|
|
|
- if contribution['ContributerName'] != config.company:
|
|
|
+ if contribution['ContributerName'] != config.company or contribution['Time'] < threshold:
|
|
|
continue
|
|
|
print('\t' + contribution['Time'])
|
|
|
for mat in contribution['Materials']:
|
|
|
@@ -40,7 +43,7 @@ def get_prices() -> typing.Mapping[str, float]:
|
|
|
|
|
|
class Infrastructure(typing.TypedDict):
|
|
|
Type: str
|
|
|
- Contributions: typing.Sequence[Contribution]
|
|
|
+ Contributions: list[Contribution]
|
|
|
|
|
|
class Contribution(typing.TypedDict):
|
|
|
ContributerName: str
|