Schedule Generator 1.0

Schedule Generator is a little Perl script that draws up a weekly schedule as a Scalable Vector Graphics image.
Schedule Generator
  2 Screenshots
Schedule Generator is a little Perl script that draws up a weekly schedule as a Scalable Vector Graphics image. Running it on your own computer may take some basic knowledge of how to use a command line, but the form interface on the demo site ought to be usable by anybody.

It's implemented as a module rather than a standalone program so that the same code can be used in a CGI script (as on the demo site) or a Perl one-liner. It depends on the SVG module.

You can call the One True Class Method of Schedule Generator, "as_string", from any Perl program. (See the POD embedded in Schedule_Generator.pm for the details.) But if you just want to draw a schedule, the best way, I think, is to write your data structure in YAML, then run this command:

cat example.yml | perl -e 'use Local::Schedule_Generator; use YAML; print Local::Schedule_Generator->as_string(%{Load do {local $/; < STDIN >;}});' > /tmp/sched.svg; inkview /tmp/sched.svg

where "example.yml" is the name of the file, and "inkview" is the name of an SVG-compatible image viewer of your choice, Inkview itself being a good candidate. Try this on the "example.yml" distributed with this program. (Make sure your current working directory is the one containing the "Local" directory and this README.) If you've never heard of "YAML" before, have no fear; it's the most intuitive data serialization language imaginable. It looks uncannily like plain text. Just edit "example.yml" to your liking. For a five-minute crash course on YAML, should you be interested, see "http://yaml.kwiki.org/?YamlInFiveMinutes". For more information, see "http://www.yaml.org" and the documentation for Perl's YAML module.

If you want a bitmap version of Schedule Generator's output, you can open the image with Inkscape and use its export feature, or you can use ImageMagick to turn the SVG (fed through standard input) into a PNG (emitted via standard output):

convert svg:- png:-

This is, in fact, the command my CGI script uses to create its PNG output.

You may wonder why I put Schedule_Generator.pm in the "Local" namespace. My thinking went like this: Schedule Generator doesn't belong on CPAN, since it's much too specific to be considered reusable code. Then it would be misleading to put it somewhere in the standard CPAN hierarchy, even though the underscore would protect it from namespace collisions. So I put it under "Local" to underscore (hee hee) its nonstandard-ness.

One final note: if you want finer control over Schedule Generator's output, look in Schedule_Generator.pm under "Hard-coded options". All the numeric variables that control the exact proportions of the schedule are there for your editing pleasure. Please excuse my brace style. I have poor eyesight, so I use such a large font for programming that I can only fit about twenty lines in one Emacs frame. For that reason, I tend to write visually compact code. It actually looks a little Pythonic, even though I'm a Perl fanboy. But TIMTOWTDI, right?

last updated on:
May 14th, 2008, 10:43 GMT
price:
FREE!
homepage:
kodi.exofire.net
license type:
Perl Artistic License 
developed by:
Kodi Arfer
category:
ROOT \ Office \ Scheduling
Schedule Generator
Download Button

In a hurry? Add it to your Download Basket!

user rating 14

3.4/5
 

0/5

Rate it!
2 Screenshots
Schedule Generator

Add your review!

SUBMIT