view requestdumpster/dumpster.py @ 2:8ddcab56f340

forgot an import
author Jeff Hammel <k0scist@gmail.com>
date Tue, 30 Jun 2015 16:13:09 -0700
parents 4ab07b01ee63
children f2f983b76090
line wrap: on
line source

#!/usr/bin/env python

"""
dump HTTP requests
"""

# imports
import optparse
import sys
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()