예제 #1
0
def main(*args):
    if len(args) == 2:
        from pkg_resources import resource_filename
        conf = resource_filename("pycoon", "pycoon.xconf")
        # Some Windows-specific file path handling
        if conf[0] != "/":
            conf = "file:///%s" % conf.replace("\\", "/")
        else:
            conf = "file://%s" % conf
    elif len(args) == 3:
        conf = args[2]
    else:
        print __doc__
        sys.exit(1)
    pycoon = wsgi.pycoonFactory({"server-xconf": conf})
    addr = (args[0], int(args[1]))
    server = CherryPyWSGIServer(addr, pycoon)
    try:
        server.start()
    except KeyboardInterrupt:
        server.stop()
예제 #2
0
def main(*args):
    if len(args) == 2:
        from pkg_resources import resource_filename
        conf = resource_filename("pycoon", "pycoon.xconf")
        # Some Windows-specific file path handling
        if conf[0] != "/":
            conf = "file:///%s" % conf.replace("\\", "/")
        else:
            conf = "file://%s" % conf
    elif len(args) == 3:
        conf = args[2]
    else:
        print __doc__
        sys.exit(1)
    pycoon = wsgi.pycoonFactory({"server-xconf": conf})
    addr = (args[0], int(args[1]))
    server = CherryPyWSGIServer(addr, pycoon)
    try:
        server.start()
    except KeyboardInterrupt:
        server.stop()
예제 #3
0
def handler(req):
    options = req.get_options()
    pycoon = wsgi.pycoonFactory({"server-xconf": options["config"]})
    Handler(req).run(pycoon)
    return apache.OK
예제 #4
0
def handler(req):
    options = req.get_options()
    pycoon = wsgi.pycoonFactory({"server-xconf": options["config"]})
    Handler(req).run(pycoon)
    return apache.OK