#!/usr/bin/python # -*- coding: utf-8 -*- # Keep those old links working since I kinda inferred that linkchecker.py was the Checklinks script :-( import cgi if __name__ == "__main__": form = cgi.FieldStorage() action = form.getfirst('action', 'view').lower() filename = form.getfirst('title', 'Checklinks').replace(' ', '_')#.replace('/', '|') redirect = "/~dispenser/%s/%s" % (action, filename) if action in ('source', 'summary', 'view', 'list', 'links',): print "Status: 301" print 'Location: ' + redirect print 'Content-Type: text/html; charset=utf-8' print print """ 301 Moved Permanently

Moved Permanently

The document has moved here.

""" % redirect else: print "Status: 410" print 'Content-Type: text/html; charset=utf-8' print print """ 410 Gone

Gone

The action (%s) has been removed.

""" % action