pacAvail
Created by Jay Brink & Stephanie Labasan
August 2013
========================================
Motivation:
There were three locations on Pacific's campus that served dual-purpose as a
classroom and as a 24/7 computer laboratory with engineering software. Near the
beginning of the semester, an admin manually goes through InsidePacific and
creates a calendar that identifies when the room is occupied by a class. This
calendar then is posted outside the room, so that students are aware when they
can take advantage of the computers and avoid disrupting a class in session.
However, the beginning of the semester is also a time when the course catalog
is changing.
Our program seeks to accomplish three things:
(1) create a script to generate calendars faster and with ease
(2) give students the ability to access the schedules from anywhere
(3) go beyond the scope of the engineering students and provide calendars
for all locations on campus and all professors, so students are aware of
when rooms are available and where professors may be at a particular time.
Our program takes a large data set and generates five-day calendars for all
unique rooms on campus and professors. Hopefully, all students will find these
helpful and easily accesible from anywhere.
Files in repo:
README Obvious
archive Delete folder and contents once confirmed they aren't
useful
cleanedClasses.txt Removes non-useful information from *Classes.txt, so
we can easily parse file
creation.py Creates index.html page
*Classes.txt Data set copied from InsidePacific
htmlfiles Directory of all calendars and CSS files, all of which
needs to be uploaded to webfolders
indexstyle.css Style formats for index page
main.py Main program
mkDict.py Generates dictionaries for all unique professors and
rooms
moveCSS.py Moves two CSS files to htmlfiles
retrieve.py Outputs cleanedClasses.txt with only lines of interest
tableStyle.css Style formats for calendars
Gathering semester course info from InsidePacific:
1) Sign in to InsidePacific
2) "Academic" tab
3) "Click here to:" under Academic Services
4) "Student & Financial Aid"
5) "Registration"
6) "Look-up Classes to Add"
7) Select term, click "Submit"
8) "Advanced Search"
9) Select all listed under "Subject:" - highlight 1 of the subjects, then hit
ctrl+a to select all
10) "Section Search"
11) ctrl+a to select entire page
12) Paste into Notepad (or similar application)
13) Save as Fall*Classes.txt or Spring*Classes.txt, where * is the last two
digits of the year.
Instructions:
1) Log into InsidePacific and copy all columns for the semester of interest
into a file called *Classes.txt (i.e. Fall13Classes.txt, Spring14Classes.txt).
See above for more detailed instructions.
2) Enter ./main.pyc, which will (a) create cleanedClasses.txt from
fallClasses.txt by calling retrieve.pyc, (b) create a sorted list for all
unique professors and rooms from cleanedClasses.txt, (c) create a dictionary
for every unique professor and room, (d) generate index.html with links to
five-day calendars for all unique professors and rooms, and (e) move CSS files
into the htmlfiles directory.
Detailed File Descriptions:
retrieve.py Reads from *Classes.txt and write only those lines that
start with a SR, C, or NR (i.e. remove all column headers,
personal information, etc) to a file called cleanedClasses.txt
mkDict.py Does the following: (a) convert the start and end time into
number of 12 min increments from 8AM (for calendar purposes),
(b) index the day of the week by a number ranging from 1 to 5,
(c) use the previous information as well as information taken
from specific columns to create a dictionary indexed by the
[time units and day of the week index] and assigned values of
().
creation.py Creates index.html with links to five-day calendars for all
professors and rooms for the semester of interest.
moveCSS.py Moves the index page CSS and calendar page CSS to the htmlfiles
directory.
--> COPY web counter code from current version on server.
Server Address: tiger.serv.pacific.edu
(source: oitfaq.pacific.edu/index.php?action=article&id=997&relid=7)
Uploading to webdocs.pacific.edu:
1) Change the strings in creation.py to be the current semester
2) Upload the entire htmlfiles/ directory via SCP. Command to be run from
~/labasanProjects/pacAvail/htmlfiles: "scp *
slabasan@tiger.serv.pacific.edu:~/web-docs/".
4) Change file permissions for all files to 444
5) Commit to git repo
Future Work:
- Automatically run program to generate up-to-date calendars once a week
- Re-design webpage for more visual appeal - completed 11/30/13
- 4/17/14 Theresa : Add course and course number to calendar (i.e. ECPE 41:
Circuits) - completed 6/26/14
- 6/26/14 Jay: Write a separate script to test the raw class data text file to
see if there are any lines with extra or too few columns
- 6/26/14 Stephanie: HTML code for the counter to be automatically inserted
into index.html
- 6/26/14 Stephanie: Edit python script to make index.html more readable
- 6/26/14 Stephanie: Title of index.html (e.g. Spring 2014 Classes) should not
be hard coded into the script, maybe have it as a command line parameter
- 8/25/15 Stephanie: Need to write some function to handle rows that are
missing columns (i.e., my_profs and my_rooms end up being invalid values).
Maybe for professors, check if the string contains "(P)"?