Ejemplo n.º 1
0
def run(publisher, req):
    response = publisher.process(apache.CGIStdin(req),
                                 apache.build_cgi_env(req))
    try:
        response.write(apache.CGIStdout(req))
    except IOError, err:
        publisher.log("IOError while  sending response ignored: %s" % err)
Ejemplo n.º 2
0
def run(publisher, req):
    from quixote.http_request import HTTPRequest
    request = HTTPRequest(apache.CGIStdin(req), apache.build_cgi_env(req))
    response = publisher.process_request(request)
    try:
        response.write(apache.CGIStdout(req))
    except IOError, err:
        publisher.log("IOError while  sending response ignored: %s" % err)
Ejemplo n.º 3
0
    def publish_modpython(self, req):
        """publish_modpython() -> None

        Entry point from mod_python.
        """
        self.__apache_request = req
        try:
            self.publish(apache.CGIStdin(req), apache.CGIStdout(req),
                         sys.stderr, apache.build_cgi_env(req))

            return apache.OK
        finally:
            self.__apache_request = None
Ejemplo n.º 4
0
    def __init__(self, req):

        from mod_python import apache

        self.stdout = apache.CGIStdout(req)
        self.stdin = apache.CGIStdin(req)

        self.stderr = FakeError()
        env = apache.build_cgi_env(req)

        self.environ = env

        scriptFilename = self.environ.get("SCRIPT_FILENAME", "")
        if scriptFilename:
            path, fn = os.path.split(scriptFilename)
            os.chdir(path)