comparison example/persona.py @ 26:feeb97e8c23c

example/persona.py
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 26 Dec 2013 21:18:15 -0800
parents e5efb021a8e6
children b411066b4929
comparison
equal deleted inserted replaced
25:e5efb021a8e6 26:feeb97e8c23c
15 page = os.path.join(here, 'persona.html') 15 page = os.path.join(here, 'persona.html')
16 16
17 class PersonaTest(object): 17 class PersonaTest(object):
18 def __init__(self, page): 18 def __init__(self, page):
19 self.page = page or globals()['page'] 19 self.page = page or globals()['page']
20 assert os.path.exists(self.page) 20 assert os.path.exists(self.page), "File '%s' not found" % self.page
21 self.page = open(self.page, 'r').read()
22 def __call__(self, environ, start_response):
23 raise NotImplementedError
21 24
22 def main(args=sys.argv[1:]): 25 def main(args=sys.argv[1:]):
23 26
24 usage = '%prog [options]' 27 usage = '%prog [options]'
25 parser = optparse.OptionParser(usage=usage, description=__doc__) 28 parser = optparse.OptionParser(usage=usage, description=__doc__)