Mercurial > hg > RequestDumpster
comparison requestdumpster/dumpster.py @ 3:f2f983b76090
more stubbing
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 30 Jun 2015 16:15:34 -0700 |
parents | 8ddcab56f340 |
children | afa7a874d28e |
comparison
equal
deleted
inserted
replaced
2:8ddcab56f340 | 3:f2f983b76090 |
---|---|
4 dump HTTP requests | 4 dump HTTP requests |
5 """ | 5 """ |
6 | 6 |
7 # imports | 7 # imports |
8 import optparse | 8 import optparse |
9 import os | |
9 import sys | 10 import sys |
11 import time | |
10 import wsgiref | 12 import wsgiref |
11 | 13 |
12 class RequestDumpster(object): | 14 class RequestDumpster(object): |
13 | 15 |
14 def __init__(self): | 16 def __init__(self, directory=None): |
15 """placeholder""" | 17 if directory is not None and not os.path.isdir(directory): |
18 raise Exception("Not a directory") | |
19 self.directory = directory | |
20 | |
16 | 21 |
17 def __call__(self, environ, start_response): | 22 def __call__(self, environ, start_response): |
18 """WSGI""" | 23 """WSGI""" |
19 | 24 |
20 def main(args=sys.argv[1:]): | 25 def main(args=sys.argv[1:]): |