@@ -41,11 +41,10 @@ class MeetingDatesDirective(SphinxDirective):
4141
4242 def run (self ):
4343 today = dt .date .today ()
44- meetings = upcoming_meetings (today )
45- self .env .meeting_dates = meetings
44+ self .env .meeting_dates = upcoming_meetings (today )
4645
4746 bullets = nodes .bullet_list ()
48- for date , hour in meetings :
47+ for date , hour in self . env . meeting_dates :
4948 item = nodes .list_item ()
5049 text = f"{ date .strftime ('%B %d, %Y' )} - { hour :02d} :00 UTC"
5150 url = f"https://arewemeetingyet.com/UTC/{ date .isoformat ()} /{ hour } :00/Docs Community Meeting"
@@ -63,14 +62,12 @@ def generate_ics(app, exception):
6362 if exception :
6463 return
6564
66- meetings = app .env .meeting_dates
67-
6865 lines = [
6966 "BEGIN:VCALENDAR" ,
7067 "VERSION:2.0" ,
7168 "PRODID:-//Python Docs Community//Meeting Dates//EN" ,
7269 ]
73- for date , hour in meetings :
70+ for date , hour in app . env . meeting_dates :
7471 start = dt .datetime (date .year , date .month , date .day , hour , 0 , 0 )
7572 end = start + dt .timedelta (hours = 1 )
7673 lines += [
@@ -86,8 +83,7 @@ def generate_ics(app, exception):
8683 "\r \n " .join (lines ) + "\r \n "
8784 ) # Required by spec for some reason: https://datatracker.ietf.org/doc/html/rfc5545#section-3.1
8885
89- path = os .path .join (app .outdir , "docs-community-meetings.ics" )
90- with open (path , "w" ) as f :
86+ with open (os .path .join (app .outdir , "docs-community-meetings.ics" ), "w" ) as f :
9187 f .write (ics )
9288
9389
0 commit comments