Skip to content

Commit

Permalink
updated the schedule generation script with more options and various …
Browse files Browse the repository at this point in the history
…small fixes here and there
  • Loading branch information
nouredd2 committed Nov 4, 2022
1 parent 5efd55c commit 11b2237
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 36 deletions.
26 changes: 11 additions & 15 deletions Admin/gen_schedule.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
# %%
import yaml
import pprint as pp
Expand All @@ -23,7 +24,6 @@ def find_sources_root(tree_root='csse332'):
logging.info("Root of source tree is {}".format(os.path.join(*curr_dir)))
return os.path.join(*curr_dir)


def parse_time_str(time_string):
"""
Parse a time string and return a datetime object.
Expand Down Expand Up @@ -52,7 +52,6 @@ def parse_time_str(time_string):

return ret_obj


def determine_starting_week(schedule):
"""
Determine the starting week of the term.
Expand All @@ -72,7 +71,6 @@ def determine_starting_week(schedule):
else:
return 1


def count_weeks(schedule, starting_week):
"""
Count the number of weeks in the quarter and determine their spans.
Expand Down Expand Up @@ -106,7 +104,6 @@ def count_weeks(schedule, starting_week):

return week_counter


def write_schedule_header(f):
"""
Write the header for the schedule in the markdown file.
Expand All @@ -133,7 +130,6 @@ def write_schedule_header(f):
</colgroup>"""
f.write(header)


def write_table_header(f):
"""
Write the header for the table in the markdown file.
Expand Down Expand Up @@ -193,12 +189,9 @@ def start_column(f, options=None):
else:
f.write("<td markdown=\"span\">\n")


def end_column(f):
f.write("</td>\n")



def write_table_body(f, schedule, num_of_sessions_per_week, classes):
"""
Write the table body based on the type of the session and so on.
Expand Down Expand Up @@ -253,12 +246,15 @@ def write_table_body(f, schedule, num_of_sessions_per_week, classes):

# check for topics
if class_content['topics']:
start_column(f, 'style=\"text-align:left\"')
# f.write("{::nomarkdown}<ul>\n")
f.write("{::nomarkdown}<ul style=\"margin:0;padding:.5rem\">\n")
for topic in class_content['topics']:
f.write("<li> {} </li>\n".format(topic))
f.write("</ul>{:/}\n")
start_column(f, 'style=\"text-align:center\"')
if len(class_content['topics']) == 1:
f.write(class_content['topics'][0])
else:
# f.write("{::nomarkdown}<ul>\n")
f.write("{::nomarkdown}<ul style=\"margin:0;padding:.5rem\">\n")
for topic in class_content['topics']:
f.write("<li> {} </li>\n".format(topic))
f.write("</ul>{:/}\n")
end_column(f)
else:
start_column(f)
Expand Down Expand Up @@ -329,7 +325,7 @@ def write_table_body(f, schedule, num_of_sessions_per_week, classes):
except KeyError:
logging.error("Failed to extract assignment from csv file!")
raise RuntimeError("Unexpected csv file entry...")
f.write("<td markdown=\"span\" colspan=\"4\">N/A</td>\n")
f.write("<td markdown=\"span\" colspan=\"4\">N/A</td>\n")
f.write("</tr>\n")

# %%
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ round-avatar: true
# If you want to have an image logo in the top-left corner instead of having the title of the website,
# then specify the following parameter
#title-img: /path/to/image
lectureurl: "/notes"
gh_repository_url: "https://github.com/RHIT-CSSE/csse332"
gh_activity_url: "https://github.com/RHIT-CSSE/csse332/tree/main/activities"
gh_homeworks_url: "https://github.com/RHIT-CSSE/csse332/tree/main/homeworks"
Expand Down
3 changes: 3 additions & 0 deletions _data/assignments.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name,dirname,date,grader,moodle
WSL2 Install,01_linux_install,2022-11-28 23:59:00,TBA,[Submission box]({{ site.gradescope_url }})
C Review & xv6 Introduction,,2022-12-01 23:59:00,TBA,[Submission box]({{ site.gradescope_url }})
39 changes: 34 additions & 5 deletions _data/schedule.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,41 @@
# <num>:
# reading:
# topics:
# materials:

1:
reading:
- <a href="https://cacm.acm.org/magazines/2016/3/198874-lessons-learned-from-30-years-of-minix/fulltext"> Lessons Learned From 30 Years of Minix </a>
- <a href="https://dsf.berkeley.edu/cs262/unix.pdf"> The UNIX Time-Sharing System </a>
topics:
- Introduction to OS
- <a href="{{ site.lectureurl }}/session01">C Review</a>
materials:

2:
reading:
topics:
- '<a href="{{ site.lectureurl }}/session02">Introduction: Roles of the OS</a>'
materials:

3:
reading:
topics:
- <a href="{{ site.lectureurl }}/session03"> The Process Abstraction </a>
materials:

4:
reading:
topics:
- <a href="{{ site.lectureurl }}/session04"> Operations on Processes </a>
materials:
- IntroToOS
- <a href="https://pages.cs.wisc.edu/~remzi/OSTEP/intro.pdf">Chapter 1</a>

# 1:
# reading:
# - <a href="https://cacm.acm.org/magazines/2016/3/198874-lessons-learned-from-30-years-of-minix/fulltext"> Lessons Learned From 30 Years of Minix </a>
# - <a href="https://dsf.berkeley.edu/cs262/unix.pdf"> The UNIX Time-Sharing System </a>
# topics:
# - Introduction to OS
# materials:
# - IntroToOS
# - <a href="https://pages.cs.wisc.edu/~remzi/OSTEP/intro.pdf">Chapter 1</a>

# 2:
# reading:
Expand Down
Binary file added favicon.ico
Binary file not shown.
42 changes: 26 additions & 16 deletions schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,49 @@ title: Class Schedule
</thead>
<tbody>
<tr>
<tr><td markdown="span" colspan="5" style="padding-top:2px;padding-bottom:2px;background-color:#167F92;color:#FFF;"></td></tr><td rowspan="4" markdown="span" style="font-size:xx-large;"><a name="w1">1</a></td>
<tr><td markdown="span" colspan="5" style="padding-top:2px;padding-bottom:2px;background-color:#167F92;color:#FFF;"></td></tr><td rowspan="6" markdown="span" style="font-size:xx-large;"><a name="w1">1</a></td>
<td markdown="span">
1 <br/> Mon, Nov 28 2022</td>
<td markdown="span" style="text-align:left;">
{::nomarkdown}<ul style="margin:0;padding:.5rem">
<li> <a href="https://cacm.acm.org/magazines/2016/3/198874-lessons-learned-from-30-years-of-minix/fulltext"> Lessons Learned From 30 Years of Minix </a> </li>
<li> <a href="https://dsf.berkeley.edu/cs262/unix.pdf"> The UNIX Time-Sharing System </a> </li>
</ul>{:/}
</td>
<td markdown="span" style="text-align:left">
{::nomarkdown}<ul style="margin:0;padding:.5rem">
<li> Introduction to OS </li>
</ul>{:/}
<td markdown="span">
</td>
<td markdown="span" style="text-align:center">
<a href="{{ site.lectureurl }}/session01">C Review</a></td>
<td markdown="span">
{::nomarkdown}<ul style="margin:0;padding:.5rem">
<li>IntroToOS</li><li><a href="https://pages.cs.wisc.edu/~remzi/OSTEP/intro.pdf">Chapter 1</a></li></ul>{:/}
</td>
</tr>
<tr>
<td markdown="span" colspan="4"> [WSL2 Install]({{ site.baseurl }}/docs/01_linux_install) DUE Mon, Nov 28 2022 23:59 [Submission box]({{ site.gradescope_url }}) <font color="#aaa"> grader: @TBA </font> </td></tr>
<tr>
<td markdown="span">
2 <br/> Tue, Nov 29 2022</td>
<td markdown="span" colspan="3">N/A</td>
<td markdown="span">
</td>
<td markdown="span" style="text-align:center">
<a href="{{ site.lectureurl }}/session02">Introduction: Roles of the OS</a></td>
<td markdown="span">
</td>
</tr>
<tr>
<td markdown="span">
3 <br/> Thu, Dec 01 2022</td>
<td markdown="span" colspan="3">N/A</td>
<td markdown="span">
</td>
<td markdown="span" style="text-align:center">
<a href="{{ site.lectureurl }}/session03"> The Process Abstraction </a></td>
<td markdown="span">
</td>
</tr>
<tr>
<td markdown="span" colspan="4"> C Review & xv6 Introduction DUE Thu, Dec 01 2022 23:59 [Submission box]({{ site.gradescope_url }}) <font color="#aaa"> grader: @TBA </font> </td></tr>
<tr>
<td markdown="span">
4 <br/> Fri, Dec 02 2022</td>
<td markdown="span" colspan="3">N/A</td>
<td markdown="span">
</td>
<td markdown="span" style="text-align:center">
<a href="{{ site.lectureurl }}/session04"> Operations on Processes </a></td>
<td markdown="span">
</td>
</tr>
<tr>
<tr><td markdown="span" colspan="5" style="padding-top:2px;padding-bottom:2px;background-color:#167F92;color:#FFF;"></td></tr><td rowspan="4" markdown="span" style="font-size:xx-large;"><a name="w2">2</a></td>
Expand Down

0 comments on commit 11b2237

Please sign in to comment.