#! /usr/bin/env python # Written by D'Arcy J.M. Cain # darcy@BikeRides.ca # All rights reserved # http://www.druid.net/rides/ # $Id: index.py,v 1.26 2009/05/31 13:17:46 darcy Exp $ import sys, os, re from DB_ride import * browser = os.environ.get('HTTP_USER_AGENT', '') sys.argv.append("") where = [ "ride_active = 't'", "((from_date + 2) >= 'TODAY' OR (to_date + 2) >= 'TODAY')", ] ex_text = """
This page lists all events in my database for which I have current information (future events.) You can also look at the entire database.""" if sys.argv[1].upper() == "FULL": ex_text = """
This is the full listing from my database including events that have already occured. If you know the dates for these events for the current year, or know of any Ontario events that have omitted, please email me and let me know.""" where = where[:1] bgcolor = "E8D8B0" fgcolor = "000000" lcolor = "A03050" elif sys.argv[1].upper() == "OCC": bgcolor = "e4e4e4" fgcolor = "000000" lcolor = "ff0000" else: bgcolor = "E8D8B0" fgcolor = "000000" lcolor = "A03050" if sys.argv[1]: where.append("UPPER(name) like '%s%%'" % sys.argv[1].upper()) ex_text = """
This is the listing for "%s". You can also look at the regular listing. """ % sys.argv[1] query = """ SELECT * FROM ride WHERE %s ORDER BY from_date""" % " AND ".join(where) print """content-type: text/html
Ontario Motorcycle RidesHere is a list of different motorcycle rides and other motorcycle events around Ontario. If I know of a web page for the event I have included a link to it. Please let me know of any events which I haven't listed or of web pages for events I have. The list is pretty open but I do have a few rules about what events can be listed here.
If you find yourself ready to run one weekend and can't find a ride near you, the Biker Lad lists the Great Ontario Bikeroads so you can just look for a cool road to try out. """ % (bgcolor, lcolor, lcolor, fgcolor) if os.environ.get("HTTP_HOST", "")[-12:] != "bikerides.ca": print """
To send me change requests on the following rides, click on the Update link of the ride you want to change.
|
For those that care about these things, here is the Python script that generated this page.