#! /usr/bin/env python # Written by D'Arcy J.M. Cain # darcy@BikeRides.ca # All rights reserved # http://BikeRides.ca/ _VERSION = "$Id$" _MODDATE = "$Date$"[7:-2] 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 Rides

Ontario Motorcycle Rides

Here 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.

  • Must be a motorcycle event
  • Must include a ride
  • Must be open to all riders and clubs
  • Must be open to all makes of motorcycles

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 """

Please note that the old URL is now deprecated and you should switch any boolmarks or links to the new URL at http://ontario.bikerides.ca/

""" """

Fallen Riders Memorial Run is June 1, 2003. All clubs and organizations are invited. This run is about honouring and respecting our fallen brothers and sisters. Please put together a contingent from your group and meet us at Queen's Park.

""" print ex_text print """

To send me change requests on the following rides, click on the Update link of the ride you want to change.

""" for ride in DB_ride().query(query).dictresult(): for k in ride.keys(): if ride[k] == None: ride[k] = "" if ride['phone'] == None: ride['phone'] = "" if ride['to_date'] == None: ride['to_date'] = "" if ride['from_date'] == None: ride['from_date'] = "" if ride['to_date'] == "" or re.match(ride['to_date'],ride['from_date']) == 0: dates = ride['from_date'] else: dates = "%(from_date)s to
%(to_date)s" % ride ride['phone'] = re.sub("^\+1", "", ride['phone']) if ride['phone'] == "": ride['phone'] = ' ' print "" if ride['url'] == "": if ride['email']: print '' % ride else: print '' % ride['name'] else: print '' % ride print '' % dates print '' % ride['phone'] if ride['email'] != "": print '' % \ (ride['email'], ride['email']) else: print '' print """""" % ride print """
List of Motorcycle Rides and Events in Ontario
Event Description Date(s) Contact Phone Email Address  
%(name)s%s%(name)s%s%s%s  Update


Created and Maintained by D'Arcy J.M. Cain <darcy@BikeRides.ca>
Last Update: 23 June 2007
If you have any comments please Send mail to me.

For those that care about these things, here is the Python script that generated this page.


[Powered by Python] [Apache logo]
""" % locals()