Compare commits
2 commits
b654e75cf5
...
9185052092
Author | SHA1 | Date | |
---|---|---|---|
Edward Betts | 9185052092 | ||
Edward Betts | 5d5b9016d1 |
|
@ -265,14 +265,20 @@ async def get_data(now: datetime) -> typing.Mapping[str, str | object]:
|
||||||
events += domains.renewal_dates(my_data)
|
events += domains.renewal_dates(my_data)
|
||||||
|
|
||||||
for launch in rockets:
|
for launch in rockets:
|
||||||
if not launch["t0_time"]:
|
dt = None
|
||||||
|
|
||||||
|
if launch["net_precision"] == "Day":
|
||||||
|
dt = datetime.strptime(launch["net"], "%Y-%m-%dT00:00:00Z").date()
|
||||||
|
elif launch["t0_time"]:
|
||||||
|
dt = pytz.utc.localize(
|
||||||
|
datetime.strptime(launch["net"], "%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
)
|
||||||
|
|
||||||
|
if not dt:
|
||||||
continue
|
continue
|
||||||
dt = pytz.utc.localize(datetime.strptime(launch["net"], "%Y-%m-%dT%H:%M:%SZ"))
|
|
||||||
e = Event(
|
rocket_name = f'🚀{launch["rocket"]}: {launch["mission"]["name"]}'
|
||||||
name="rocket",
|
e = Event(name="rocket", date=dt, title=rocket_name)
|
||||||
date=dt,
|
|
||||||
title=f'🚀{launch["rocket"]}: {launch["mission"]["name"]}',
|
|
||||||
)
|
|
||||||
events.append(e)
|
events.append(e)
|
||||||
|
|
||||||
events.sort(key=operator.attrgetter("as_datetime"))
|
events.sort(key=operator.attrgetter("as_datetime"))
|
||||||
|
|
|
@ -193,7 +193,11 @@
|
||||||
—
|
—
|
||||||
{{ launch.orbit.name }} ({{ launch.orbit.abbrev }})
|
{{ launch.orbit.name }} ({{ launch.orbit.abbrev }})
|
||||||
<br/>
|
<br/>
|
||||||
<a href="{{ launch.pad_wikipedia_url }}">{{ launch.pad_name }}</a>
|
{% if launch.pad_wikipedia_url %}
|
||||||
|
<a href="{{ launch.pad_wikipedia_url }}">{{ launch.pad_name }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ launch.pad_name }} {% if launch.pad_name != "Unknown Pad" %}(no Wikipedia article){% endif %}
|
||||||
|
{% endif %}
|
||||||
— {{ launch.location }}<br/>
|
— {{ launch.location }}<br/>
|
||||||
|
|
||||||
{% for line in launch.mission.description.splitlines() %}
|
{% for line in launch.mission.description.splitlines() %}
|
||||||
|
|
Loading…
Reference in a new issue