2019-04-08 16:01:54 +00:00
|
|
|
import collections
|
|
|
|
import copy
|
|
|
|
import io
|
|
|
|
import logging
|
|
|
|
import os
|
2020-06-29 11:57:21 +00:00
|
|
|
import random
|
2020-01-29 13:34:12 +00:00
|
|
|
import sys
|
2019-04-08 16:01:54 +00:00
|
|
|
import tarfile
|
2020-06-29 11:57:21 +00:00
|
|
|
import time
|
2019-04-08 16:01:54 +00:00
|
|
|
|
|
|
|
import requests
|
|
|
|
|
|
|
|
import util
|
|
|
|
|
|
|
|
|
2020-03-13 19:35:03 +00:00
|
|
|
def get_events(args):
|
|
|
|
events = []
|
|
|
|
skip = True
|
|
|
|
with open(os.path.join(args.docs_dir, '..', 'README.md')) as f:
|
|
|
|
for line in f:
|
|
|
|
if skip:
|
|
|
|
if 'Upcoming Events' in line:
|
|
|
|
skip = False
|
|
|
|
else:
|
|
|
|
if not line:
|
|
|
|
continue
|
|
|
|
line = line.strip().split('](')
|
|
|
|
if len(line) == 2:
|
|
|
|
tail = line[1].split(') ')
|
|
|
|
events.append({
|
|
|
|
'signup_link': tail[0],
|
|
|
|
'event_name': line[0].replace('* [', ''),
|
|
|
|
'event_date': tail[1].replace('on ', '').replace('.', '')
|
|
|
|
})
|
|
|
|
return events
|
2020-04-15 13:35:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
logging.basicConfig(
|
|
|
|
level=logging.DEBUG,
|
|
|
|
stream=sys.stderr
|
|
|
|
)
|