Mercurial > mozilla > hg > dogfood
changeset 9:f517d80bafe0
more stubbing
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 16 Oct 2012 16:49:29 -0700 |
parents | ebb65758d725 |
children | 235738f81a3d |
files | dogdish/dispatcher.py |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/dogdish/dispatcher.py Tue Oct 16 16:34:22 2012 -0700 +++ b/dogdish/dispatcher.py Tue Oct 16 16:49:29 2012 -0700 @@ -14,6 +14,7 @@ here = os.path.dirname(os.path.abspath(__file__)) class Handler(object): + """abstract handler object for a request""" def __init__(self, request): self.request = request @@ -34,14 +35,18 @@ raise exc.HTTPSeeOther(location=location) class Get(Handler): + """handle GET requests""" + # template for response body body = """<?xml version="1.0"?> <updates> <update type="minor" appVersion="19.0a1" version="19.0a1" extensionVersion="19.0a1" buildID="20121010114416" licenseURL="http://www.mozilla.com/test/sample-eula.html" detailsURL="http://www.mozilla.com/test/sample-details.html"> - <patch type="complete" URL="http://update.boot2gecko.org/nightly/b2g_update_2012-10-10_114416.mar%s" hashFunction="SHA512" hashValue="84edb1f53891cf983bc0f6066d31492f43e2d063aaceb05e1c51876f4fde81635afeb7ce3203dee6f65dd59be0cae5c73c49093b625c99acd4118000ad72dda8" size="42924805"/> + <patch type="complete" URL="http://update.boot2gecko.org/nightly/b2g_update_2012-10-10_114416.mar%(query)s" hashFunction="SHA512" hashValue="84edb1f53891cf983bc0f6066d31492f43e2d063aaceb05e1c51876f4fde81635afeb7ce3203dee6f65dd59be0cae5c73c49093b625c99acd4118000ad72dda8" size="42924805"/> </update> </updates>""" + ### methods for request handler + @classmethod def match(cls, request): return request.method == 'GET' @@ -63,6 +68,8 @@ body=body % query) class Dispatcher(object): + """web application""" + ### class level variables defaults = {'directory': here}