Skip to content

Commit 20d761b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2f59730 commit 20d761b

19 files changed

Lines changed: 56 additions & 70 deletions

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ cython_debug/
192192
.abstra/
193193

194194
# Visual Studio Code
195-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
195+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
196196
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
197-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
197+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
198198
# you could uncomment the following to ignore the entire vscode folder
199199
# .vscode/
200200

src/ep_markdown.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,39 @@
1212
# =============
1313

1414
BLEACH_TAGS = [
15-
"a", "abbr", "acronym", "b", "blockquote", "br", "code", "em", "hr",
16-
"i", "li", "ol", "p", "pre", "strong", "ul",
17-
"h1", "h2", "h3", "h4", "h5", "h6", "img",
15+
"a",
16+
"abbr",
17+
"acronym",
18+
"b",
19+
"blockquote",
20+
"br",
21+
"code",
22+
"em",
23+
"hr",
24+
"i",
25+
"li",
26+
"ol",
27+
"p",
28+
"pre",
29+
"strong",
30+
"ul",
31+
"h1",
32+
"h2",
33+
"h3",
34+
"h4",
35+
"h5",
36+
"h6",
37+
"img",
1838
]
1939
BLEACH_ATTRS = {
2040
"a": ["href", "title"],
2141
"img": ["src", "alt", "title"],
22-
"h1": ["id"], "h2": ["id"], "h3": ["id"],
23-
"h4": ["id"], "h5": ["id"], "h6": ["id"],
42+
"h1": ["id"],
43+
"h2": ["id"],
44+
"h3": ["id"],
45+
"h4": ["id"],
46+
"h5": ["id"],
47+
"h6": ["id"],
2448
}
2549

2650
_MD_EXTENSIONS = ["fenced_code", "toc"]
@@ -104,9 +128,7 @@ def _build_toc(html: str) -> str:
104128
if not items:
105129
return ""
106130
return (
107-
'<div class="info-toc">'
108-
'<div class="info-toc-title">Table of Contents</div>'
109-
'<ul>' + "".join(items) + "</ul></div>"
131+
'<div class="info-toc"><div class="info-toc-title">Table of Contents</div><ul>' + "".join(items) + "</ul></div>"
110132
)
111133

112134

@@ -118,5 +140,6 @@ def parse_frontmatter(text: str) -> tuple[dict, str]:
118140
if len(parts) < 3:
119141
return {}, text
120142
import yaml
143+
121144
meta = yaml.safe_load(parts[1]) or {}
122145
return meta, parts[2]

src/gen_flower_tile.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ def _load_flowers() -> list[tuple[str, str, str]]:
5555

5656
def _build_symbols(flowers: list[tuple[str, str, str]]) -> list[str]:
5757
"""Build <symbol> definitions for all flowers."""
58-
return [
59-
f' <symbol id="{fid}" viewBox="{vb}">{inner}</symbol>'
60-
for fid, vb, inner in flowers
61-
]
58+
return [f' <symbol id="{fid}" viewBox="{vb}">{inner}</symbol>' for fid, vb, inner in flowers]
6259

6360

6461
def _use_element(flower_id: str, x: float, y: float, size: float, rotation: float, flip: int) -> str:
@@ -75,7 +72,9 @@ def _use_element(flower_id: str, x: float, y: float, size: float, rotation: floa
7572

7673

7774
def _circles_overlap(
78-
cx: float, cy: float, r: float,
75+
cx: float,
76+
cy: float,
77+
r: float,
7978
placed: list[tuple[float, float, float]],
8079
min_gap: float,
8180
*,
@@ -136,8 +135,8 @@ def _build_tile(flowers: list[tuple[str, str, str]]) -> str:
136135
return (
137136
f'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n'
138137
f' viewBox="0 0 {CANVAS} {CANVAS}" width="{CANVAS}" height="{CANVAS}">\n'
139-
f'<defs>\n{chr(10).join(symbols)}\n</defs>\n'
140-
f'{chr(10).join(uses)}\n</svg>\n'
138+
f"<defs>\n{chr(10).join(symbols)}\n</defs>\n"
139+
f"{chr(10).join(uses)}\n</svg>\n"
141140
)
142141

143142

@@ -183,8 +182,7 @@ def _build_separator(flowers: list[tuple[str, str, str]]) -> str:
183182
y = y_center - size / 2
184183
cx, cy, r = x + size / 2, y_center, size / 2
185184

186-
if not _circles_overlap(cx, cy, r, placed, SEP_MIN_GAP,
187-
toroidal_w=SEP_WIDTH):
185+
if not _circles_overlap(cx, cy, r, placed, SEP_MIN_GAP, toroidal_w=SEP_WIDTH):
188186
rotation = rng.uniform(0, 360)
189187
flip = rng.choice([1, -1])
190188
placements.append((flower_id, x, y, size, rotation, flip))
@@ -207,8 +205,8 @@ def _build_separator(flowers: list[tuple[str, str, str]]) -> str:
207205
return (
208206
f'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n'
209207
f' viewBox="0 0 {SEP_WIDTH} {SEP_HEIGHT}" width="{SEP_WIDTH}" height="{SEP_HEIGHT}">\n'
210-
f'<defs>\n{chr(10).join(symbols)}\n</defs>\n'
211-
f'{chr(10).join(uses)}\n</svg>\n'
208+
f"<defs>\n{chr(10).join(symbols)}\n</defs>\n"
209+
f"{chr(10).join(uses)}\n</svg>\n"
212210
)
213211

214212

src/keynotes.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ class Keynote:
88
name: str
99
role: str
1010
bio: str
11-
photo: (
12-
str # local path relative to site root, e.g. "keynotes/sebastian-ramirez.webp"
13-
)
11+
photo: str # local path relative to site root, e.g. "keynotes/sebastian-ramirez.webp"
1412
is_placeholder: bool = False
1513
session_code: str = "" # pretalx code, resolved to url at build time
1614
session_url: str = ""
@@ -64,8 +62,7 @@ class Keynote:
6462
Keynote(
6563
"Mystery Keynote #6",
6664
"To be announced",
67-
"Our final keynote slot is reserved for someone special."
68-
" Watch this space — the announcement is coming.",
65+
"Our final keynote slot is reserved for someone special. Watch this space — the announcement is coming.",
6966
"",
7067
is_placeholder=True,
7168
),

src/models.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def time_display(self) -> str:
8282
e = self.end.strftime("%H:%M") if self.end else ""
8383
return f"{s}{e} CEST" if e else f"{s} CEST"
8484

85-
8685
@property
8786
def track_id(self) -> str:
8887
"""URL-safe slug of the track name."""
@@ -111,10 +110,7 @@ def session_page_up_next(self) -> list:
111110
return []
112111
end_str = self.end.strftime("%H:%M")
113112
cutoff = (self.end + timedelta(minutes=30)).strftime("%H:%M")
114-
return [
115-
slot for slot in self.schedule_day_slots
116-
if end_str <= slot.start_time <= cutoff
117-
]
113+
return [slot for slot in self.schedule_day_slots if end_str <= slot.start_time <= cutoff]
118114

119115
def get_speaker_names(self) -> str:
120116
"""Return lowercase speaker names for search indexing."""

src/schedule.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
}
2323

2424

25-
def build_schedule(
26-
raw: dict, sessions: dict[str, Session]
27-
) -> list[ScheduleDay]:
25+
def build_schedule(raw: dict, sessions: dict[str, Session]) -> list[ScheduleDay]:
2826
"""Build structured schedule days from raw schedule data and resolved sessions."""
2927
if not raw:
3028
return []
@@ -78,19 +76,13 @@ def _filter_events(events: list[ScheduleEvent], rooms_set: set[str]) -> list[Sch
7876
return [e for e in events if any(r in rooms_set for r in e.rooms)]
7977

8078

81-
def _is_spanning(
82-
event: ScheduleEvent, events_at_time: list[ScheduleEvent], rooms_set: set[str]
83-
) -> bool:
79+
def _is_spanning(event: ScheduleEvent, events_at_time: list[ScheduleEvent], rooms_set: set[str]) -> bool:
8480
"""Determine if an event should span all columns."""
8581
if event.is_break:
8682
return True
8783

8884
if (event.session_type or "") in _SPANNING_TYPES:
89-
room_events = [
90-
e
91-
for e in events_at_time
92-
if any(r in rooms_set for r in e.rooms) and not e.is_break
93-
]
85+
room_events = [e for e in events_at_time if any(r in rooms_set for r in e.rooms) and not e.is_break]
9486
distinct_titles = {e.title for e in room_events}
9587
return len(distinct_titles) == 1
9688

@@ -124,9 +116,7 @@ def _make_entry(
124116
)
125117

126118

127-
def _posters_at_time(
128-
all_events: list[ScheduleEvent], time_key: str, sessions: dict[str, Session]
129-
) -> list[Session]:
119+
def _posters_at_time(all_events: list[ScheduleEvent], time_key: str, sessions: dict[str, Session]) -> list[Session]:
130120
"""Collect poster sessions from hidden rooms at a given time."""
131121
posters = []
132122
for e in all_events:

src/scripts/script.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,4 +421,3 @@ document.addEventListener('keydown', function(e) {
421421
document.addEventListener('mousedown', function() {
422422
document.body.classList.remove('keyboard-nav');
423423
});
424-

src/search_index.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def build_index(
4444
for spk in speakers:
4545
entries.append(_index_speaker(spk))
4646

47-
for tier in (sponsor_tiers or []):
47+
for tier in sponsor_tiers or []:
4848
for sponsor in tier.sponsors:
4949
entries.append(_index_sponsor(sponsor, tier.label))
5050

51-
for cp in (community_partners or []):
51+
for cp in community_partners or []:
5252
entries.append(_index_community_partner(cp))
5353

5454
out = build_dir / "search-index.json"
@@ -260,5 +260,3 @@ def collect_links() -> list[Link]:
260260
seen.add(item.url)
261261
links.append(item)
262262
return links
263-
264-

src/templates/blocks/connect.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,3 @@ <h2 class="sec-title connect-title">LET'S CONNECT <sup class="sec-anchor"><a hre
7878

7979
</div>
8080
</section>
81-

src/templates/blocks/ep25.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ <h2 class="sec-title ep25-title">25 YEARS OF <span>EUROPYTHON <sup class="sec-an
4848

4949
</div>
5050
</section>
51-

0 commit comments

Comments
 (0)