Ajout lien live (à tester)

This commit is contained in:
Jean Lapostolle 2023-02-18 02:31:20 +01:00
parent 542d634e7f
commit fd94d547b3
1 changed files with 13 additions and 1 deletions

View File

@ -130,6 +130,14 @@ def parse_args():
return parser.parse_args()
salle2livelink = {
"franklin" : "https://indymotion.fr/w/dm3DZdr1FQGQJjyvfm419M",
"darwin" : "https://indymotion.fr/w/p7yGkZtpHeatdAaxwktweC",
"edison": "https://indymotion.fr/w/fBgSz6w6qPuseoN6p2VDA2",
"wegener": "https://indymotion.fr/w/kNpt3HaqJZBctY3v2AZGR2",
"poincaré": "https://indymotion.fr/w/bzkxJBMBcz2ucxXV8N5U1a"
}
def toot_for(talk, ahead_days=0):
"""Redact a toot for a given talk."""
if ahead_days:
@ -137,14 +145,18 @@ def toot_for(talk, ahead_days=0):
else:
msg = f"Salle {talk.room} : « {talk.title} » présenté par {talk.author}, c'est maintenant !"
msg += "\n\nLe programme : https://www.pycon.fr/2023/fr/schedule.html"
msg += f"\n\nRetrouvez la conférence en direct sur {salle2livelink[talk.room]}"
return msg
def live_toot(talks, mastodon: Mastodon, ahead_days=0):
for talk in talks:
if talk.category == "Sprint":
continue # We don't toot sprints.
if talk.room not in salle2livelink.keys():
continue
toot = toot_for(talk, ahead_days)
png_name = f"talk-{talk.id}.png"
with suppress(FileNotFoundError):