-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed 3ad4507 with MkDocs version: 1.4.2
- Loading branch information
Unknown
committed
Apr 16, 2024
0 parents
commit 016794b
Showing
140 changed files
with
57,239 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from datetime import datetime, date, timedelta | ||
import yaml | ||
|
||
def daterange(start_date, end_date): | ||
for n in range(int((end_date - start_date).days)): | ||
yield start_date + timedelta(n) | ||
|
||
def get_input_datetime(prompt): | ||
while True: | ||
try: | ||
print(prompt) | ||
input_date = input().split("/") | ||
return datetime(int(input_date[2]), int(input_date[0]), int(input_date[1])) | ||
except IndexError as e: | ||
print(f"Error occurred in processing date input: {e}") | ||
pass | ||
|
||
start_date = get_input_datetime("Enter semester start date (mm/dd/yyyy):") | ||
end_date = get_input_datetime("Enter semester end date (mm/dd/yyyy):") | ||
|
||
dict_file = [] | ||
for single_date in daterange(start_date, end_date): | ||
if (single_date.weekday() > 4): | ||
continue | ||
|
||
str_date = single_date.strftime("%a %b %d") | ||
dict_file.append({ | ||
"date": str_date, | ||
"lecture": { | ||
"name": "", | ||
"link": "" | ||
}, | ||
"recitation": { | ||
"name": "", | ||
"slides": "", | ||
"handout": "", | ||
"quiz": "" | ||
}, | ||
"reading": { | ||
"name": "", | ||
"link": "" | ||
}, | ||
"homework": { | ||
"name": "", | ||
"deadline": "", | ||
"link": "", | ||
"numDays": 0 | ||
} | ||
}) | ||
|
||
class LineBreakDumper(yaml.SafeDumper): | ||
# Reference: https://github.com/yaml/pyyaml/issues/127 | ||
def write_line_break(self, data=None): | ||
super().write_line_break(data) | ||
|
||
if len(self.indents) == 1: | ||
super().write_line_break() | ||
|
||
with open(r'schedule.yaml', 'w') as file: | ||
yaml.dump(dict_file, file, Dumper=LineBreakDumper, default_flow_style=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- name: Canvas | ||
link: https://canvas.cmu.edu/courses/39473 | ||
icon: assets/images/logos/canvas.png | ||
|
||
- name: Slack | ||
link: https://cmu-17-776-s24.slack.com/ | ||
icon: assets/images/logos/slack.png | ||
|
||
- name: Gradescope | ||
link: https://www.gradescope.com/courses/704199 | ||
icon: assets/images/logos/gradescope.png | ||
|
||
- name: GitHub | ||
link: https://classroom.github.com/classrooms/34176362-17356-software-engineering-for-startups-spring2024 | ||
icon: assets/images/logos/github-mark.png | ||
|
||
- name: Dronuts | ||
link: dronuts | ||
icon: assets/images/logos/drone.png |
Oops, something went wrong.