Managing Your Schedule

Feature: Schedule

Python Code

I've implemented everything in Python, and the code is viewable in my repository here. Please let me know if you find any bugs or want to request any features. Note that it's still under development, and I plan to make some significant changes in the near futue (specifically splitting schedconv.py into multiple modules). Also note that most of the explanations on this page can be found in the ~/sched.conf file itself.

Rowan Schedule

Rowan students can very easily create a schedule using Banner. Simply save your "Concise Student Schedule" as ~/rowan.html on ~grandline. Running the command mentioned later in the "Generating Your Schedule" section will use the file to generate your schedule.

Custom Schedule

You can create custom events by editing your ~/sched.conf file. Note that any lines beginning with # are ignored by the program. These are called "comments" and can contain anything. The default sched.conf contains some explanation in the beginning using comments. If you delete your sched.conf you can find a copy at /home/share/sched.conf. In order to add things to your schedule, you must use some specific syntax. Only lines that don't start with # will be added. Events are started using sections, which are simply text enclosed in []. A single event is then a block of lines starting with a section header and ending just before the next section (or the end of the file). You can have an unlimited number of events.

Title

Events start with a section header like [Name of Event] which will appear on the schedule as its name. Names must be unique. The next three lines can be in any order, but all must be present. Currently the title will be truncated to 11 characters, and python's str.title() method is applied.

dates

The dates field must look like dates = YYYY/MM/DD-YYYY/MM/DD and denotes the start and end dates of the event. They must be in exactly the format specified above.

meets

The meets field must look like meets = D(T-T,T-T,...) D(T-T) ... where "D" is a day of the week from U M T W R F S and "T" is a time. The time can be specified in 12-hour format (e.g. 8a or 9:30p), in 24-hour format (e.g. 8 or 21:30), or as noon or midnight.

location

The location field can be any string in the form location = LOCATION which will appear as the location for the event on the schedule.

Examples

This event named "McChicken Monday" starts on 2015/01/01; ends on 2016/01/01; meets at "McDonald's"; on Monday from 9:30PM to 11:00PM.

[McChicken Monday]
dates = 2015/01/01-2016/01/01
meets = M(9p-11p)
location = McDonald's

This event named "Work" starts on 2015/01/01; ends on 2016/01/01; meets at "Philadelphia"; on Monday, Tuesday, Wednesday, Thursday, and Friday from 8:00AM to 5:00PM.

[Work]
dates = 2015/01/01-2016/01/01
meets = MTWRF(8a-5p)
location = Philadelphia

This event named "Exercise" starts on 2015/01/01; ends on 2016/01/01; meets at "Gym"; on Monday and Friday from 8:00AM to 9:00AM and from 12:00PM to 1:00PM; and on Wednesday from 5:00PM to 6:00PM.

[Exercise]
dates = 2015/01/01-2016/01/01
meets = MF(8a-9a,noon-1p) W(5p-6p)
location = Gym

Schedule Options

You can change how your schedule is displayed using the special section [HTML Options] in your ~/sched.conf file. These options are presented below in groups since many of them are similar. Most of them aren't explained individually since their names are self-explanatory. The default value for each option is given to the right of them.

Color Options

These options accept a color either as an X11 color name or as an HTML hex code starting with the # character.

page-bg-color         #FFFFFF
empty-cell-bg-color #808080
border-color #000000
event-cell-font-color #000000
event-cell-bg-color #FFFFFF

String Options

These options accept any string, although font-family is preferrably a valid web-safe font.

title                 Schedule
font-family Verdana

Boolean Options

These options accept either True or False. The table-only option only writes the <table> tags and what's inside them to ~/public_html/sched.html. This is useful if you'd like to include the table in a webpage elsewhere in your website hierarchy or with custom formatting and minimal work. See my linked schedule page and my raw sched.html for reference.

write-html            False
table-only False
border-collapse True

Generating Your Schedule

Once you have your ~/sched.conf ready (the ~/rowan.html is optional) all you have to do is run sched on ~grandline. It will create a text file ~/sched-ascii.txt that contains an ASCII schedule. You can view other users' ASCII schedule using the command sched username. If you enable the write-html option, it also creates ~/public_html/sched.html that is viewable in a web browser. Simply navigate to grandline.jahschwa.com/~username/sched.html, or click the corresponding shcedule icon on the ~grandline Homepage. As long as you have the file ~/public_html/sched.html, a schedule icon will appear on the Pirates table. As always, note that the table updates once per minute, and you must refresh the page to see the update. Also note that if your schedule has conflicts, the process will fail, and the conflicts will be recoreded in ~/sched.log.

Your schedule is automatically updated every week between Saturday and Sunday at midnight via a cron job run as your user using su. This way, events will be updated at the beginning of each week, so events that start in the future will be added when appropriate, and events that are over will be deleted when appropriate.