Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore builtin schedule display #45

Merged
merged 9 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/people/3DCSNN.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/7SWEAL.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/8LCDDU.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/8NDWMQ.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/8NFJSF.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/8UFZNX.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/98HVRZ.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/9JG7DV.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/9JGCPM.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/9WJJPL.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/AHET73.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/ATDLZU.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/BHGMDT.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/BHTKP3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/CYVHAC.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/DEZCB8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/EJ9MHD.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/FTUWNC.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/HBDX9R.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/HQSSZQ.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/JFJVXW.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/JJR3W8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/JTPU7J.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/KCADCR.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/LDFVBH.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/people/MSEC3L.jpg
Binary file added public/people/MY7QMZ.jpg
Binary file added public/people/N9ZZWG.jpg
Binary file added public/people/NTEJEK.jpg
Binary file added public/people/P9CXX8.jpg
Binary file added public/people/PAMFZZ.jpg
Binary file added public/people/PB9BKD.jpg
Binary file added public/people/PFTMME.jpg
Binary file added public/people/PGYLJB.jpg
Binary file added public/people/Q7H3M8.jpg
Binary file added public/people/QD8GMS.jpg
Binary file added public/people/QWCHX7.jpg
Binary file added public/people/RB3PZZ.jpg
Binary file added public/people/RSUKRU.jpg
Binary file added public/people/TQKR8P.jpg
Binary file added public/people/VQZYV9.jpg
Binary file added public/people/VXBVLZ.jpg
Binary file added public/people/X99XWA.jpg
Binary file added public/people/XPM9RU.jpg
Binary file added public/people/YCFJET.jpg
Binary file added public/people/ZUWBQU.jpg
Binary file added public/people/ZY7KJB.jpg
Binary file added public/people/ZZQ9TE.jpg
166 changes: 104 additions & 62 deletions scripts/schedule_sync.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import os
import os.path
import pathlib
from datetime import timedelta
from io import BytesIO
from os import environ
from pprint import pprint

import bleach
import dateutil.parser
Expand All @@ -15,10 +11,24 @@
from ruamel.yaml import YAML

PRETALX_TOKEN = environ["PRETALX_TOKEN"]
ACST = dateutil.tz.gettz("Australia/Adelaide")
AEST = dateutil.tz.gettz("Australia/Melbourne")

# Per-year configuration
EVENT_TIMEZONE = dateutil.tz.gettz("Australia/Melbourne")
ROOMS = {
"Goldfields Theatre": "goldfields",
"Eureka 2": "eureka2",
"Eureka 3": "eureka3",
}
TRACKS = {
"DevOops": "devoops",
"Education": "education",
"Scientific Python": "scientific",
"Main Conference": None,
}

CONTENT_DIR = pathlib.Path("../src/content")
SESSIONS_DIR = CONTENT_DIR / "sessions"
BREAKS_DIR = CONTENT_DIR / "breaks"
PEOPLE_DIR = CONTENT_DIR / "people"
PUBLIC_DIR = pathlib.Path("../public")
PEOPLE_IMGS_DIR = PUBLIC_DIR / "people"
Expand Down Expand Up @@ -69,19 +79,6 @@ def parse_markdown(text):
)


rooms = {
"Goldfields Theatre": "a",
"Eureka 2": "b",
"Eureka 3": "c",
}

tracks = {
"DevOops": "devoops",
"Education": "education",
"Scientific Python": "scientific",
"Main Conference": None,
}

answers = {
"Content Warning": 3747,
"Pronouns": 3948,
Expand Down Expand Up @@ -136,62 +133,71 @@ def parse_markdown(text):

speakers = [x["code"] for x in session["speakers"]]
seen_speakers.update(speakers)
with (SESSIONS_DIR / f'{session["code"]}.yml').open("w") as f:
if session["slot"] and session["slot"]["start"] and session["slot"]["end"]:
start = dateutil.parser.isoparse(session["slot"]["start"]).astimezone(AEST)
end = dateutil.parser.isoparse(session["slot"]["end"]).astimezone(AEST)
else:
start = None
end = None
# type_answer_id = format_answer[next(
# x["options"][0]["id"] for x in session["answers"] if x["question"]["id"] == answers["Presentation Format"]
# )]
cw = next(
(
x["answer"]
for x in session["answers"]
if x["question"]["id"] == answers["Content Warning"]
),
None,
)
online = (
next(
(
x["answer"]
for x in session["answers"]
if x["question"]["id"] == answers["Online"]
),
None,
)
!= "In person in Adelaide"
if session["slot"] and session["slot"]["start"] and session["slot"]["end"]:
start = dateutil.parser.isoparse(session["slot"]["start"]).astimezone(
EVENT_TIMEZONE
)
twitter = next(
(
x["answer"]
for x in session["answers"]
if x["question"]["id"] == answers["Twitter"]
),
None,
end = dateutil.parser.isoparse(session["slot"]["end"]).astimezone(
EVENT_TIMEZONE
)
fedi = next(
else:
start = None
end = None
# type_answer_id = format_answer[next(
# x["options"][0]["id"] for x in session["answers"] if x["question"]["id"] == answers["Presentation Format"]
# )]
cw = next(
(
x["answer"]
for x in session["answers"]
if x["question"]["id"] == answers["Content Warning"]
),
None,
)
online = (
next(
(
x["answer"]
for x in session["answers"]
if x["question"]["id"] == answers["Fedi"]
if x["question"]["id"] == answers["Online"]
),
None,
)
track = session["track"]
# if track is not None:
# track = tracks[track["en"]]
# else:
# print(f"!!! {session['code']} has no track assigned")
!= "In person in Adelaide"
)
twitter = next(
(
x["answer"]
for x in session["answers"]
if x["question"]["id"] == answers["Twitter"]
),
None,
)
fedi = next(
(
x["answer"]
for x in session["answers"]
if x["question"]["id"] == answers["Fedi"]
),
None,
)
track = session["track"]
if track is None:
print(f"!!! {session['code']} has no track assigned, skipping")
continue
elif "(waitlist)" in track["en"]:
print(f"{session['code']} is waitlisted, skipping")
continue
else:
track = TRACKS[track["en"]]

with (SESSIONS_DIR / f'{session["code"]}.yml').open("w") as f:
yaml.dump(
{
"title": session["title"],
"start": start,
"end": end,
"room": rooms[session["slot"]["room"]["en"]]
"room": ROOMS[session["slot"]["room"]["en"]]
if session["slot"] and session["slot"]["room"]
else None,
"track": track,
Expand All @@ -208,6 +214,40 @@ def parse_markdown(text):
f,
)

BREAKS_DIR.mkdir(exist_ok=True)
for entry in BREAKS_DIR.glob("*"):
entry.unlink()

# If a schedule is published, collect breaks
schedule = requests.get(
"https://pretalx.com/api/events/pycon-au-2024/schedules/latest/",
headers={"Authorization": f"Token {PRETALX_TOKEN}"},
)
if schedule.ok:
for break_ in schedule.json()["breaks"]:
# We only want to copy across breaks that aren't actually breaks
description = break_["description"]["en"]
if "break" in description.lower() or "lunch" in description.lower():
continue

with (
BREAKS_DIR / f"{break_['room_id']}-{break_['start'].replace(':','-')}.yml"
).open("w") as f:
start = dateutil.parser.isoparse(break_["start"]).astimezone(EVENT_TIMEZONE)
end = dateutil.parser.isoparse(break_["end"]).astimezone(EVENT_TIMEZONE)
yaml.dump(
{
"room": ROOMS[break_["room"]["en"]],
"start": start,
"end": end,
"description": break_["description"]["en"],
},
f,
)


PEOPLE_IMGS_DIR.mkdir(exist_ok=True)

with (CONTENT_DIR / "_people_etags.yml").open("r") as f:
etags = yaml.load(f)

Expand All @@ -225,6 +265,8 @@ def parse_markdown(text):
if speaker["avatar"] is not None:
etag = etags.get(speaker["code"], None)
print(speaker["avatar"])
if not speaker["avatar"]:
continue
avatar_resp = requests.get(
speaker["avatar"],
headers={"If-None-Match": etag} if etag is not None else {},
Expand Down
3 changes: 2 additions & 1 deletion src/content/_people_etags.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
BUWU8Z: '"qo20fa2v42a"'
PB9BKD: '"sgy6i7n7k"'
JFJVXW: '"sgt3t8q6j"'
VXBVLZ: '"qsyzc829gh"'
Expand All @@ -15,6 +14,7 @@ FTUWNC: '"sdvwpt2g64"'
8LCDDU: '"rx8zix1edr"'
P9CXX8: '"sgrq2r65pt"'
PFTMME: '"ruq8px2k13"'
AHET73: '"rx8zg1121x"'
7SWEAL: '"sgul1c27xw"'
PGYLJB: '"ruq8zsyh7"'
NTEJEK: '"sgv2ie1cbe"'
Expand Down Expand Up @@ -45,3 +45,4 @@ YCFJET: '"ru9zvr8wjk"'
8NDWMQ: '"qydfaealb"'
9WJJPL: '"rrdvff2b3i"'
3DCSNN: '"sitdpvf1c"'
JJR3W8: '"sjb916jc6"'
4 changes: 4 additions & 0 deletions src/content/breaks/3410-2024-11-23T08-25-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: goldfields
start: 2024-11-23 08:25:00+11:00
end: 2024-11-23 08:45:00+11:00
description: First Timers Session
4 changes: 4 additions & 0 deletions src/content/breaks/3410-2024-11-23T09-00-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: goldfields
start: 2024-11-23 09:00:00+11:00
end: 2024-11-23 09:25:00+11:00
description: Conference Opening (Saturday)
4 changes: 4 additions & 0 deletions src/content/breaks/3410-2024-11-23T09-25-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: goldfields
start: 2024-11-23 09:25:00+11:00
end: 2024-11-23 10:10:00+11:00
description: 'Keynote (to be announced) '
4 changes: 4 additions & 0 deletions src/content/breaks/3410-2024-11-23T15-50-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: goldfields
start: 2024-11-23 15:50:00+11:00
end: 2024-11-23 16:50:00+11:00
description: Lightning Talks (Saturday)
4 changes: 4 additions & 0 deletions src/content/breaks/3410-2024-11-24T09-00-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: goldfields
start: 2024-11-24 09:00:00+11:00
end: 2024-11-24 09:20:00+11:00
description: Conference Opening (Sunday)
4 changes: 4 additions & 0 deletions src/content/breaks/3410-2024-11-24T09-20-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: goldfields
start: 2024-11-24 09:20:00+11:00
end: 2024-11-24 10:05:00+11:00
description: Keynote (to be announced)
4 changes: 4 additions & 0 deletions src/content/breaks/3410-2024-11-24T15-50-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: goldfields
start: 2024-11-24 15:50:00+11:00
end: 2024-11-24 16:50:00+11:00
description: Lighting Talks (Sunday)
4 changes: 4 additions & 0 deletions src/content/breaks/3410-2024-11-24T16-50-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: goldfields
start: 2024-11-24 16:50:00+11:00
end: 2024-11-24 17:30:00+11:00
description: Closing Address (Sunday)
4 changes: 4 additions & 0 deletions src/content/breaks/3412-2024-11-22T09-20-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: eureka3
start: 2024-11-22 09:20:00+11:00
end: 2024-11-22 09:50:00+11:00
description: '[placeholder] Education Track Keynote'
4 changes: 4 additions & 0 deletions src/content/breaks/3412-2024-11-22T15-30-00+11-00.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
room: eureka3
start: 2024-11-22 15:30:00+11:00
end: 2024-11-22 17:20:00+11:00
description: Student Showcase
27 changes: 20 additions & 7 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z, defineCollection } from "astro:content"
import { DateTime } from "luxon"
import { ROOM_SLUGS, SPECIALIST_TRACK_SLUGS } from "../main_config"

const sponsors = defineCollection({
schema: z.object({
Expand All @@ -20,19 +20,31 @@ const sessions = defineCollection({
title: z.string(),
abstract: z.string(),
description: z.string(),
track: z.enum(["devoops", "education", "scientific"]).nullable(),
track: z.enum(SPECIALIST_TRACK_SLUGS).nullable(),
code: z.string(),
speakers: z.array(z.string()),
cw: z.string().nullable(),
youtube_slug: z.string().nullable(),
youtube_slug: z.string().nullable().optional().default(null),
start: z.date().nullable(),
end: z.date().nullable(),
room: z.enum(["a", "b", "c", "e"]).nullable(),
type: z.enum(["talk", "stall", "open-close", "special", "keynote"]),
room: z.enum(ROOM_SLUGS).nullable(),
type: z
.enum(["talk", "stall", "open-close", "special", "keynote"])
.optional()
.default("talk"),
online: z.boolean(),
}),
type: "data",
})
const breaks = defineCollection({
schema: z.object({
room: z.enum(ROOM_SLUGS),
start: z.date(),
end: z.date(),
description: z.string(),
}),
type: "data",
})
const people = defineCollection({
schema: z.object({
name: z.string(),
Expand All @@ -49,6 +61,7 @@ export const collections = {
sponsors,
pages,
tracks,
//sessions,
//people,
sessions,
breaks,
people,
}
9 changes: 9 additions & 0 deletions src/content/people/AHET73.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Evan Kohilas
pronouns:
twitter:
fedi:
bio: "<p>Evan is a Senior Software Engineer whose passions lie in improving the developer
experience by enhancing code health, optimising workflows, and working towards nohumanerrors.com</p>\n
<p>When he's not thinking about security, informatics, or giving talks about his
many projects, you'll find him nomming on Subway cookies, or chasing bunny rabbits.</p>"
has_pic: true
2 changes: 1 addition & 1 deletion src/content/people/CYVHAC.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Matt Cengia
pronouns:
twitter:
fedi: '@mattcen@aus.social'
fedi: https://aus.social/@mattcen
bio: <p>Matt (they/them/their) is a queer, autistic nonbinary human with ADHD, from
the lands of Wurundjeri people of the Kulin nation (so-called Melbourne, Australia).
They have a long background in Linux systems admin and software development, as
Expand Down
6 changes: 6 additions & 0 deletions src/content/people/DXVSSE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: Lisa Wilson
pronouns:
twitter:
fedi:
bio: <p>Female software engineer in a man's world.</p>
has_pic: false
4 changes: 2 additions & 2 deletions src/content/people/JJR3W8.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Mel
name: Mel Makin
pronouns:
twitter:
fedi:
bio: <p>Dr Mel Makin is a senior scientific software engineer from the Australian
Synchrotron. She completed her PhD in quantum physics at the University of Melbourne
in 2011. Since that time, she has worked on many software projects.</p>
has_pic: false
has_pic: true
Loading