summaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
authorBlaise Thompson <blaise@untzag.com>2024-09-08 15:24:57 -0500
committerBlaise Thompson <blaise@untzag.com>2024-09-08 15:24:57 -0500
commit9767d14540fd04af7322750ac38b463db554079d (patch)
tree0c617035d43bdb1111f4d5e89e2f0b01654e35c9 /build.py
parent6cd581d9d0f3e6adc215d2c73b481f0df895d0aa (diff)
no need to read org to file
Diffstat (limited to 'build.py')
-rw-r--r--build.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/build.py b/build.py
index f57a0b1..91906a2 100644
--- a/build.py
+++ b/build.py
@@ -58,21 +58,19 @@ with open(org_fp, "r") as org:
url = "https://outlook.office365.com/owa/calendar/db2d3e0f0490459a80c4b837118e4bf1@wisc.edu/f6a2b5209cd6432c96f52939cacdbedd2266851683387467601/calendar.ics"
subprocess.run(["curl", url, "-o", "/home/nginx/pycal2org/uw-madison.ics"])
-subprocess.run(["python3", "/home/nginx/pycal2org/pycal2org.py", "/home/nginx/pycal2org/uw-madison.ics", ">", "/home/nginx/pycal2org/uw-madison.org"])
-org_fp = "/home/nginx/pycal2org/uw-madison.org"
-
-with open(org_fp, "r") as org:
- for line in org:
- line = line.strip()
- if not line:
- continue
- if not line[0] == "*":
- continue
- if ":private:" in line:
- continue
- if ":info:" in line:
- continue
- events.append(Event(line))
+proc = subprocess.Popen(["python3", "/home/nginx/pycal2org/pycal2org.py", "/home/nginx/pycal2org/uw-madison.ics", ">", "/home/nginx/pycal2org/uw-madison.org"])
+org = proc.stdout.read()
+for line in org:
+ line = line.strip()
+ if not line:
+ continue
+ if not line[0] == "*":
+ continue
+ if ":private:" in line:
+ continue
+ if ":info:" in line:
+ continue
+ events.append(Event(line))