changeset 1:4ab07b01ee63

begin to stub dumpster
author Jeff Hammel <k0scist@gmail.com>
date Tue, 30 Jun 2015 16:12:23 -0700
parents b53ce9bde2c8
children 8ddcab56f340
files requestdumpster/dumpster.py
diffstat 1 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/requestdumpster/dumpster.py	Tue Jun 30 16:12:23 2015 -0700
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+"""
+dump HTTP requests
+"""
+
+import optparse
+import wsgiref
+
+class RequestDumpster(object):
+
+    def __init__(self):
+        """placeholder"""
+
+    def __call__(self, environ, start_response):
+        """WSGI"""
+
+def main(args=sys.argv[1:]):
+    """CLI"""
+
+    # parse command line arguments
+    parser = optparse.OptionParser(description=__doc__)
+    parser.add_option('-p', '--port', dest='port',
+                      type='int', default=9555,
+                      help="port to serve on")
+    options = parser.parse_args()
+
+    # construct url
+    url = 'http://localhost:{port}/'.format(port=options.port)
+
+if __name__ == '__main__':
+    main()