Skip to content

Commit 2330d3a

Browse files
committed
generate calender, typos
1 parent 06e55e2 commit 2330d3a

File tree

12 files changed

+224
-9
lines changed

12 files changed

+224
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ jobs:
2828

2929
- name: Install Python deps
3030
run: pip install -U -r requirements.txt
31+
3132
- name: Render Pages
3233
run: python render.py
3334

35+
- name: Generate Calender
36+
run: python ical_gen.py
37+
3438
- name: Upload artifact
3539
uses: actions/upload-pages-artifact@v3
3640
with:

ical_gen.py

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
#!/usr/bin/python #!/usr/bin/python
2+
3+
import os
4+
import os.path
5+
import sys
6+
import shutil
7+
import markdown2
8+
import yaml
9+
10+
from pathlib import Path
11+
from render import PageRendered, _read
12+
13+
from icalendar import Calendar, Event, vCalAddress, vText
14+
from datetime import datetime, timedelta
15+
from pathlib import Path
16+
import os
17+
import pytz
18+
19+
# init the calendar
20+
cal = Calendar()
21+
cal.add('prodid', 'ical_gen')
22+
cal.add('version', "2.0" )
23+
24+
SLOTS_META = {}
25+
26+
def define_slot(id, start, minutes, kind=None):
27+
global SLOTS_META, LE
28+
if isinstance(start, str):
29+
s = datetime.fromisoformat(start)
30+
else:
31+
s = start
32+
e = s + timedelta(minutes=minutes)
33+
LE = e
34+
SLOTS_META[id] = (s, e, kind)
35+
36+
LE = None
37+
def create_break(title, start, minutes):
38+
global LE
39+
if isinstance(start, str):
40+
s = datetime.fromisoformat(start)
41+
else:
42+
s = start
43+
44+
e = s + timedelta(minutes=minutes)
45+
LE = e
46+
47+
# Add subcomponents
48+
event = Event()
49+
event.add("uid", hash(title))
50+
event.add("dtstamp", datetime.now())
51+
52+
event.add('summary', title)
53+
#event.add('description', c)
54+
55+
event.add('dtstart', s)
56+
event.add('dtend', e)
57+
58+
# Add the organizer
59+
organizer = vCalAddress('MAILTO:[email protected]')
60+
# Add parameters of the event
61+
organizer.params['name'] = vText('Alexander Weigl')
62+
organizer.params['role'] = vText('Program Chair')
63+
event['organizer'] = organizer
64+
event['location'] = vText('Bad Herrenalb, Germany')
65+
cal.add_component(event)
66+
67+
day0 = lambda x: f'2024-07-29T{x}:00'
68+
day1 = lambda x: f'2024-07-30T{x}:00'
69+
day2 = lambda x: f'2024-07-31T{x}:00'
70+
day3 = lambda x: f'2024-08-01T{x}:00'
71+
72+
C_SOCIAL = 'blue'
73+
C_BREAK = 'grey'
74+
C_INVITED = 'red'
75+
C_KEY = 'turkoise'
76+
C_KEYM = 'lightblue'
77+
78+
define_slot(999, day0('13:00'), 60*5, C_SOCIAL)
79+
define_slot(998, day1('19:00'), 120, C_SOCIAL)
80+
81+
create_break('Coffee Break', day1('10:30'), 30)
82+
create_break('Lunch', day1('12:30'), 30)
83+
create_break('Coffee Break', day1('15:30'), 30)
84+
#
85+
create_break('Coffee Break', day2('10:30'), 30)
86+
create_break('Lunch', day2('12:30'), 30)
87+
create_break('Coffee Break', day2('15:30'), 30)
88+
#
89+
create_break('Coffee Break', day3('10:30'), 30)
90+
create_break('Lunch', day3('12:30'), 30)
91+
92+
define_slot(10, day1('08:45'), 15)
93+
define_slot(11, LE, 60)
94+
define_slot(12, LE, 15)
95+
define_slot(123, LE, 15)
96+
97+
define_slot(113, day1('11:00'), 30)
98+
define_slot(114, LE, 30)
99+
define_slot(115, LE, 30)
100+
101+
define_slot(213, day1('11:00'), 30)
102+
define_slot(214, LE, 30)
103+
define_slot(215, LE, 30)
104+
105+
define_slot(116, day1('14:00'), 30)
106+
define_slot(117, LE, 30)
107+
define_slot(118, LE, 30)
108+
109+
define_slot(216, day1('14:00'), 30)
110+
define_slot(217, LE, 30)
111+
define_slot(218, LE, 30)
112+
113+
define_slot(19, day1('16:00'), 30)
114+
define_slot(191, LE, 30)
115+
define_slot(192, LE, 30)
116+
define_slot(193, LE, 30)
117+
118+
#####################################
119+
define_slot(20, day2('09:00'), 60)
120+
define_slot(21, LE, 15)
121+
define_slot(22, LE, 15)
122+
123+
define_slot(13, day2('11:00'), 30)
124+
define_slot(14, LE, 30)
125+
define_slot(15, LE, 30)
126+
127+
define_slot(207, day2('14:00'), 30)
128+
define_slot(208, LE, 30)
129+
define_slot(209, LE, 30)
130+
131+
define_slot(16, day2('16:00'), 30)
132+
define_slot(17, LE, 30)
133+
define_slot(18, LE, 30)
134+
define_slot(199, LE, 30)
135+
136+
137+
#####################################
138+
define_slot(30, day3('09:00'), 60)
139+
define_slot(31, LE, 30)
140+
#define_slot(22, LE, 15)
141+
142+
define_slot(32, day3('11:00'), 15)
143+
define_slot(33, LE, 15)
144+
define_slot(34, LE, 15)
145+
define_slot(35, LE, 15)
146+
define_slot(36, LE, 10)
147+
148+
#from pprint import pprint
149+
#pprint(SLOTS_META)
150+
151+
152+
def main():
153+
talks = []
154+
bySlot = {}
155+
156+
for fn in Path("talks/").rglob("*.md"):
157+
t = _read(fn)
158+
try:
159+
bySlot[t.meta['slot']] = t
160+
talks.append(t)
161+
except:
162+
print(f"No slot defined for {fn}")
163+
164+
165+
for p in talks:
166+
# Add subcomponents
167+
m = p.meta
168+
c = p.content
169+
event = Event()
170+
author = str(m['author'])
171+
title = m['title']
172+
173+
event.add('summary', f"{author}: {title}")
174+
event.add('description', c)
175+
176+
try:
177+
(s,e,k) = SLOTS_META[m['slot']]
178+
179+
event.add('color', k)
180+
event.add('categories', k)
181+
182+
event.add('dtstart', s)
183+
event.add('dtend', e)
184+
except:
185+
print(f"Slot not defined {m['slot']}")
186+
187+
# Add the organizer
188+
organizer = vCalAddress('MAILTO:[email protected]')
189+
# Add parameters of the event
190+
organizer.params['name'] = vText('Alexander Weigl')
191+
organizer.params['role'] = vText('Program Chair')
192+
event['organizer'] = organizer
193+
event['location'] = vText('Bad Herrenalb, Germany')
194+
cal.add_component(event)
195+
196+
# Write to disk
197+
output = Path("public") / 'events.ics'
198+
with output.open('wb') as f:
199+
f.write(cal.to_ical())
200+
201+
202+
if __name__ == "__main__": main()

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
jinja2
2-
markdown2
2+
markdown2
3+
icalendar

talks/blanchette.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
author: Jasmin Blanchette
3+
kind: "Invited Talk (60 min.)"
4+
track: "Common Track"
5+
title: "tbd"
6+
slot: 30
7+
length: 60
8+
---

talks/graetz.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
2+
author: "Lukas Grätz"
33
kind: "Regular Talk (20 min. + 10 min.)"
44
track: "Common Track"
55
title: "Single Path Verification for Validation or Debugging"

talks/heydari-tabar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
2+
author: "Asmae Heydari-Tabar"
33
kind: "Short Talk (10 min. + 5 min.)"
44
track: "Common Track, KeY-only Track"
55
title: "Data Dependence Logic: Applications"

talks/schiffl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
2+
author: "Jonas Schiffl"
33
kind: "Short Talk (10 min. + 5 min.)"
44
track: "Common Track"
55
title: "What is Live? Temporal Properties in Smart Contract Applications"

talks/teuber.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
2+
author: "Samuel Teuber"
33
kind: "Short or Regular Talk (please let me know which one)"
44
track: "Common Track"
55
title: "Heterogeneous Dynamic Logic"

talks/ulbrich.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
2+
author: "Mattias Ulbrich"
33
kind: "Regular Talk (20 min. + 10 min.)"
44
track: "Common Track, KeY-only Track"
55
title: "<as discussed>"

talks/ungzb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
2+
author: "Anne Hoff"
33
kind: "Short Talk (10 min. + 5 min.)"
44
track: "Common Track"
55
title: "Formal verification of verifiable, traceable and secret online elections"

0 commit comments

Comments
 (0)