'Dispatching logic. There are three paths defined:
/ - Display an empty form asking for an identity URL to
verify
/verify - Handle form submission, initiating OpenID verification
/process - Handle a redirect from an OpenID server
Any other path gets a 404 response. This function also parses
the query parameters.
If an exception occurs in this function, a traceback is
written to the requesting browser.'

def do_GET(self):

    try:
        self.parsed_uri = urlparse.urlparse(self.path)
        self.query = {}
        for (k, v) in cgi.parse_qsl(self.parsed_uri[4]):
            self.query[k] = v.decode('utf-8')
        path = self.parsed_uri[2]
        if (path == '/'):
            self.render()
        elif (path == '/verify'):
            self.doVerify()
        elif (path == '/process'):
            self.doProcess()
        elif (path == '/affiliate'):
            self.doAffiliate()
        else:
            self.notFound()
    except (KeyboardInterrupt, SystemExit):
        raise
    except:
        self.send_response(500)
        self.send_header('Content-type', 'text/html')
        self.setSessionCookie()
        self.end_headers()
        self.wfile.write(cgitb.html(sys.exc_info(), context=10))
