annotate dogdish/dispatcher.py @ 13:71f9f68986b5

directory scanning + caching
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 17 Oct 2012 10:56:38 -0700
parents 234c2427e52b
children cffb6f681b59
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2cb8b06d64df minor fixes
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
1 #!/usr/bin/env python
2cb8b06d64df minor fixes
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
2
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
1
2cb8b06d64df minor fixes
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
4 dogdish
7
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
5 https://bugzilla.mozilla.org/show_bug.cgi?id=800118
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 """
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7
12
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
8 import fnmatch
8
ebb65758d725 add a default directory
Jeff Hammel <jhammel@mozilla.com>
parents: 7
diff changeset
9 import os
4
4a5a4582be3b forgot an import
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
10 import sys
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 from urlparse import urlparse
4
4a5a4582be3b forgot an import
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
12 from webob import Request
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 from webob import Response, exc
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
14 from ConfigParser import RawConfigParser as ConfigParser
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15
8
ebb65758d725 add a default directory
Jeff Hammel <jhammel@mozilla.com>
parents: 7
diff changeset
16 here = os.path.dirname(os.path.abspath(__file__))
ebb65758d725 add a default directory
Jeff Hammel <jhammel@mozilla.com>
parents: 7
diff changeset
17
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
18
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
19 class Application(object):
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
20 """class for storing application.ini data"""
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
21
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
22 def __init__(self, filename):
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
23 """
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
24 - filename : path to an application.ini file
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
25 """
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
26
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
27 ### request handlers
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
28
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 class Handler(object):
9
f517d80bafe0 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 8
diff changeset
30 """abstract handler object for a request"""
1
2cb8b06d64df minor fixes
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
31
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32 def __init__(self, request):
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33 self.request = request
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34 self.application_path = urlparse(request.application_url)[2]
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
36 def link(self, path=(), permanant=False):
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
37 if isinstance(path, basestring):
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
38 path = [ path ]
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
39 path = [ i.strip('/') for i in path ]
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
40 if permanant:
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
41 application_url = [ self.request.application_url ]
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
42 else:
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
43 application_url = [ self.application_path ]
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
44 path = application_url + path
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
45 return '/'.join(path)
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
46
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
47 def redirect(self, location):
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
48 raise exc.HTTPSeeOther(location=location)
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
49
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
50 class Get(Handler):
9
f517d80bafe0 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 8
diff changeset
51 """handle GET requests"""
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
52
9
f517d80bafe0 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 8
diff changeset
53 # template for response body
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
54 body = """<?xml version="1.0"?>
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
55 <updates>
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
56 <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">
9
f517d80bafe0 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 8
diff changeset
57 <patch type="complete" URL="http://update.boot2gecko.org/nightly/b2g_update_2012-10-10_114416.mar%(query)s" hashFunction="SHA512" hashValue="84edb1f53891cf983bc0f6066d31492f43e2d063aaceb05e1c51876f4fde81635afeb7ce3203dee6f65dd59be0cae5c73c49093b625c99acd4118000ad72dda8" size="42924805"/>
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
58 </update>
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
59 </updates>"""
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
60
9
f517d80bafe0 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 8
diff changeset
61 ### methods for request handler
f517d80bafe0 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 8
diff changeset
62
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
63 @classmethod
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
64 def match(cls, request):
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
65 return request.method == 'GET'
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
66
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
67 def __call__(self):
7
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
68 body = self.body
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
69 query = {}
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
70 dogfood_id = self.request.GET.get('dogfood_id')
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
71 if dogfood_id:
12
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
72 query['dogfooding_prerelease_id'] = dogfood_id
7
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
73
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
74 # build query string
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
75 if query:
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
76 query = '?' + '&'.join(['%s=%s' % (key, value) for key, value in query.items()])
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
77 else:
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
78 query = ''
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
79
12
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
80 # template variables
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
81 variables = dict(query=query)
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
82
1
2cb8b06d64df minor fixes
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
83 return Response(content_type='text/xml',
12
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
84 body=body % variables)
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
85
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
86 class Dispatcher(object):
9
f517d80bafe0 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 8
diff changeset
87 """web application"""
f517d80bafe0 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 8
diff changeset
88
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
89
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
90 ### class level variables
8
ebb65758d725 add a default directory
Jeff Hammel <jhammel@mozilla.com>
parents: 7
diff changeset
91 defaults = {'directory': here}
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
92
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
93 def __init__(self, **kw):
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
94
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
95 # set defaults
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
96 for key in self.defaults:
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
97 setattr(self, key, kw.get(key, self.defaults[key]))
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
98 self.handlers = [ Get ]
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
99 self.updates = {}
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
100 self.current_update = None
13
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
101 self.current_stamp = '0000-00-00_000000'
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
102
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
103 # scan directory
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
104 self.scan()
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
105
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
106 def __call__(self, environ, start_response):
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
107 """WSGI application"""
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
108
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
109 request = Request(environ)
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
110 for h in self.handlers:
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
111 if h.match(request):
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
112 handler = h(request)
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
113 break
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
114 else:
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
115 handler = exc.HTTPNotFound
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
116 res = handler()
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
117 return res(environ, start_response)
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
118
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
119 def scan(self):
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
120 """scan the directory for updates"""
13
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
121 prefix = 'b2g_update_'
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
122 suffix = '.mar'
12
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
123 contents = [i for i in os.listdir(self.directory)
13
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
124 if i.startswith(prefix) and i.endswith(suffix)]
12
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
125 contents = set(contents)
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
126 new = contents.difference(self.updates.keys())
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
127 if not new:
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
128 # directory contents unchanged from cached values
234c2427e52b beginnings of a scan function
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
129 return
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
130
13
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
131 for update in new:
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
132 stamp = update[len(prefix):-len(suffix)]
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
133 application_ini = 'application_%s.ini' % stamp
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
134 application_ini = os.path.join(self.directory, application_ini)
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
135 assert os.path.exists(application_ini)
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
136 self.updates[update] = Application(application_ini)
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
137 if stamp > self.current_stamp:
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
138 self.current_update = update
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
139 self.current_stamp = stamp
71f9f68986b5 directory scanning + caching
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
140
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
141 def main(args=sys.argv[1:]):
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
142 """CLI entry point"""
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
143
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
144 # imports for CLI
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
145 import optparse
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
146 from wsgiref import simple_server
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
147
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
148 # parse CLI options
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
149 parser = optparse.OptionParser()
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
150 parser.add_option('-p', '--port', dest='port',
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
151 default=8080, type='int',
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
152 help="port to serve on")
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
153 parser.add_option('-d', '--directory', dest='directory',
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
154 default=os.getcwd(),
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
155 help="directory of update files")
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
156 options, args = parser.parse_args()
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
157
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
158 # create the app
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
159 app = Dispatcher(directory=options.directory)
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
160
11
5babc2ae6c27 more stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 9
diff changeset
161 # serve the app
7
65d0a1153864 a stub that sorta does something
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
162 print "http://localhost:%s/" % options.port
0
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
163 server = simple_server.make_server(host='0.0.0.0', port=options.port, app=app)
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
164 server.serve_forever()
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
165
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
166 if __name__ == '__main__':
b3fd8f98df32 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
167 main()