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
|
2022-03-22 16:39:58 +00:00
|
|
|
with open(os.path.join(args.docs_dir, "..", "README.md")) as f:
|
2020-03-13 19:35:03 +00:00
|
|
|
for line in f:
|
|
|
|
if skip:
|
2022-03-22 16:39:58 +00:00
|
|
|
if "Upcoming Events" in line:
|
2020-03-13 19:35:03 +00:00
|
|
|
skip = False
|
|
|
|
else:
|
|
|
|
if not line:
|
|
|
|
continue
|
2022-03-22 16:39:58 +00:00
|
|
|
line = line.strip().split("](")
|
2020-03-13 19:35:03 +00:00
|
|
|
if len(line) == 2:
|
2022-03-22 16:39:58 +00:00
|
|
|
tail = line[1].split(") ")
|
|
|
|
events.append(
|
|
|
|
{
|
|
|
|
"signup_link": tail[0],
|
|
|
|
"event_name": line[0].replace("* [", ""),
|
|
|
|
"event_date": tail[1].replace("on ", "").replace(".", ""),
|
|
|
|
}
|
|
|
|
)
|
2020-03-13 19:35:03 +00:00
|
|
|
return events
|
2020-04-15 13:35:16 +00:00
|
|
|
|
|
|
|
|
2022-03-22 16:39:58 +00:00
|
|
|
if __name__ == "__main__":
|
|
|
|
logging.basicConfig(level=logging.DEBUG, stream=sys.stderr)
|