Differences between revisions 9 and 16 (spanning 7 versions)
Revision 9 as of 2010-09-02 20:56:19
Size: 2621
Editor: trogdor
Comment:
Revision 16 as of 2010-09-16 21:25:50
Size: 3233
Editor: trogdor
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
Scheduler is a simple python script that creates Instructional Lab Schedules (example: [[attachment:103_4320.ps]]<<FootNote(You can go to http://pages.cs.wisc.edu/~ghost/gsview/index.htm to get a viewer for ps files)>>, or [[103 Schedule|here]] (png format)) from a set of simple text files. By default, the program creates a summary page that has a 12-up view of all the schedules, and detail pages for each of the individual schedules (these are about 8 inches square). {i} Updates! See below... Now scheduler has '''much''' better error reporting, {{{reader.py}}} will show you the line and column number of any errors in the input files.

Scheduler is a python script that creates Instructional Lab Schedules from a set of text files. By default, the program creates a summary page that has a 12-up view of all the schedules, and detail pages (8.5" x 5") for each of the individual schedules that are suitable for labeling the lab rooms (please print these on green cardstock).
Line 20: Line 22:
Input files must be named in the form `<lab num>_<room num>.txt`. The first column has a comma (',') with no space on either side separating the day of the week and the start time. Times are in 24-hour format. Columns are separated by any amount of tabs or spaces but cannot span lines. Lines may begin with an octothorpe/hash/pound-sign ('#') and they will be ignored. Blank lines are also allowed, so please include them between days for readability. Input files must be named in the form `<lab num>_<room num>.txt`. The first column has a comma (',') with no space on either side separating the day of the week and the start time. Times are in 24-hour format. Columns are separated by any amount of tabs or spaces but cannot span lines. Lines that begin with a pound-sign ('#') will be ignored. Blank lines are also allowed, so please include them between days for readability.

{i} As of 2010-9-16, the config file is actually ''parsed'' and not just sliced-and-diced with string subscripting as it was before. Errors are found out much more effectively this way. Another addition is that the parser allows for section numbers to be prefixed with parenthetical course numbers. An example:

{{{
T,14:25 (321)301 Dhorkah 17:25
T,19:00 (321)302 Dhorkah 22:00

W,14:25 (623)301 McDermott 17:25
W,19:00 (623)303 McDermott 22:00
}}}

This is handy for rooms that are used for multiple labs.
Line 24: Line 38:
To run the file just execute it from the command line (it takes no arguments): To run the script just [[http://effbot.org/pyfaq/how-do-i-make-a-python-script-executable-on-unix.htm|execute]] it from the command line (it takes no arguments). An example of the output:
Line 37: Line 51:
C:\Documents and Settings\user\Desktop\scheduler>scheduler.py C:\Documents and Settings\user\Desktop\scheduler> scheduler.py
Line 45: Line 59:
There is also a mode for making single signs.

{{{
[cwilson@trogdor]$ ./scheduler.py 103_4320.txt 103_4320.ps
(there's no output)
}}}

I've also added a makefile to make all PS files do:
{{{
make
}}}

to also make PNG images, do:
{{{
make img
}}}
(you'll need ImageMagic, GhostScript, and bash).
Line 47: Line 79:
 * tarball [[attachment:scheduler.tar.gz]]
 * image files: [[attachment:103_4320.png]], [[attachment:104_3320.png]], [[attachment:104_3328.png]], [[attachment:109_3124.png]], [[attachment:201_4314.png]], [[attachment:202_3310.png]], [[attachment:202_3314.png]], [[attachment:207_4310.png]], [[attachment:208_3254.png]], [[attachment:248_3136.png]], [[attachment:308_4336.png]], [[attachment:summary.png]]
Line 52: Line 82:
026a63c7770834d1eb3ea23408075a7cdf207b36 scheduler.zip 9dd18becb771aad9ecc929a77b6b0be447b99bc2 scheduler.zip

Overview

{i} Updates! See below... Now scheduler has much better error reporting, reader.py will show you the line and column number of any errors in the input files.

Scheduler is a python script that creates Instructional Lab Schedules from a set of text files. By default, the program creates a summary page that has a 12-up view of all the schedules, and detail pages (8.5" x 5") for each of the individual schedules that are suitable for labeling the lab rooms (please print these on green cardstock).

Configuration

This is an example of the layout of an input file (called '103_4320.txt'):

M,12:05 301     Ojalvo    14:00
M,14:25 302     Carmody   16:20
M,16:35 303     Ojalvo    18:30
M,19:05 304     N/A       21:00

T,7:45  305     Carmody    9:40
T,9:55  306     Zeng      11:50
T,12:05 307     Zeng      14:00
...

and so on...

Input files must be named in the form <lab num>_<room num>.txt. The first column has a comma (',') with no space on either side separating the day of the week and the start time. Times are in 24-hour format. Columns are separated by any amount of tabs or spaces but cannot span lines. Lines that begin with a pound-sign ('#') will be ignored. Blank lines are also allowed, so please include them between days for readability.

{i} As of 2010-9-16, the config file is actually parsed and not just sliced-and-diced with string subscripting as it was before. Errors are found out much more effectively this way. Another addition is that the parser allows for section numbers to be prefixed with parenthetical course numbers. An example:

T,14:25 (321)301        Dhorkah         17:25
T,19:00 (321)302        Dhorkah         22:00

W,14:25 (623)301        McDermott       17:25
W,19:00 (623)303        McDermott       22:00

This is handy for rooms that are used for multiple labs.

Usage

To run the script just execute it from the command line (it takes no arguments). An example of the output:

[cwilson@trogdor]$ ./scheduler.py 
Generating summary in [summary.ps]...DONE
Generating individual in [103_4320.ps]...DONE
Generating individual in [104_3328.ps]...DONE
Generating individual in [201_4314.ps]...DONE
Generating individual in [207_4310.ps]...DONE

Windows:

C:\Documents and Settings\user\Desktop\scheduler> scheduler.py
Generating summary in [summary.ps]...DONE
Generating individual in [103_4320.ps]...DONE
Generating individual in [104_3328.ps]...DONE
Generating individual in [201_4314.ps]...DONE
Generating individual in [207_4310.ps]...DONE

There is also a mode for making single signs.

[cwilson@trogdor]$ ./scheduler.py 103_4320.txt 103_4320.ps
(there's no output)

I've also added a makefile to make all PS files do:

make

to also make PNG images, do:

make img

(you'll need ImageMagic, GhostScript, and bash).

Download

sha1sum

9dd18becb771aad9ecc929a77b6b0be447b99bc2  scheduler.zip

Bugs/Questions/Comments

Please contact cwilson@physics.wisc.edu

il: Scheduler (last edited 2017-04-21 14:38:46 by ChadSeys)