Exemplo n.º 1
0
    def __init__(self,
                 path,
                 command,
                 channel,
                 response,
                 stdin=None,
                 environ=None,
                 globbing=None,
                 recursive=0,
                 size=None):

        # we need to store the globbing information to pass it
        # to the ZPublisher and the manage_FTPlist function
        # (ajung)
        self.globbing = globbing
        self.recursive = recursive

        if stdin is None:
            size = 0
            stdin = StringIO()

        if environ is None:
            environ = self._get_env(path, command, channel, stdin, size)

        self._orig_env = environ
        HTTPRequest.__init__(self, stdin, environ, response, clean=1)

        # support for cookies and cookie authentication
        self.cookies = channel.cookies
        if '__ac' not in self.cookies and channel.userid != 'anonymous':
            self.other['__ac_name'] = channel.userid
            self.other['__ac_password'] = channel.password
        for k, v in self.cookies.items():
            if k not in self.other:
                self.other[k] = v
Exemplo n.º 2
0
    def __init__(self, path, command, channel, response, stdin=None,
                 environ=None, globbing=None, recursive=0, size=None):

        # we need to store the globbing information to pass it
        # to the ZPublisher and the manage_FTPlist function
        # (ajung)
        self.globbing = globbing
        self.recursive = recursive

        if stdin is None:
            size = 0
            stdin = StringIO()

        if environ is None:
            environ = self._get_env(path, command, channel, stdin, size)

        self._orig_env = environ
        HTTPRequest.__init__(self, stdin, environ, response, clean=1)

        # support for cookies and cookie authentication
        self.cookies = channel.cookies
        if '__ac' not in self.cookies and channel.userid != 'anonymous':
            self.other['__ac_name'] = channel.userid
            self.other['__ac_password'] = channel.password
        for k, v in self.cookies.items():
            if k not in self.other:
                self.other[k] = v
Exemplo n.º 3
0
 def __init__(self, language=None):
     resp = HTTPResponse(stdout=sys.stdout)
     environ = {}
     environ['SERVER_NAME'] = 'foo'
     environ['SERVER_PORT'] = '80'
     environ['REQUEST_METHOD'] = 'GET'
     environ['SCRIPT_NAME'] = '/foo/test'
     environ['SESSION'] = None
     self.SESSION = {}
     HTTPRequest.__init__(self, None, environ, resp)
     if language: self.setLanguage(language)
Exemplo n.º 4
0
 def __init__(self,language=None):
     resp = HTTPResponse(stdout=sys.stdout)
     environ={}
     environ['SERVER_NAME']='foo'
     environ['SERVER_PORT']='80'
     environ['REQUEST_METHOD'] = 'GET'
     environ['SCRIPT_NAME']='/foo/test'
     environ['SESSION']=None
     self.SESSION={}
     HTTPRequest.__init__(self,None,environ,resp)
     if language: self.setLanguage(language)
Exemplo n.º 5
0
    def __init__(self, response, interval):
        stdin = StringIO()
        environ = self._get_env(stdin)
        HTTPRequest.__init__(self, stdin, environ, response, clean=1)

        self.other['interval'] = interval
Exemplo n.º 6
0
    def __init__(self, response, interval):
        stdin=StringIO()
        environ=self._get_env(stdin)
        HTTPRequest.__init__(self, stdin, environ, response, clean=1)

        self.other['interval'] = interval