• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(142)  |  Call(93)  |  Derive(4)  |  Import(45)
Class used by open_ftp() for cache of open FTP connections.

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/urllib2.py   ironruby(Download)
except ImportError:
    from StringIO import StringIO
 
from urllib import (unwrap, unquote, splittype, splithost, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
##        fw.ftp.set_debuglevel(1)
        return fw
 
class CacheFTPHandler(FTPHandler):
    # XXX would be nice to have pluggable cache strategies
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/urllib2.py   ironruby(Download)
except ImportError:
    from StringIO import StringIO
 
from urllib import (unwrap, unquote, splittype, splithost, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
##        fw.ftp.set_debuglevel(1)
        return fw
 
class CacheFTPHandler(FTPHandler):
    # XXX would be nice to have pluggable cache strategies
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

src/m/e/mechanize-HEAD/mechanize/_urllib2_fork.py   mechanize(Download)
    return None, url
 
 
from urllib import (unwrap, unquote, splittype, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        try:
            fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
        except TypeError:
            # Python < 2.6, no per-connection timeout support
            fw = ftpwrapper(user, passwd, host, port, dirs)
##        fw.ftp.set_debuglevel(1)
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

src/p/y/pyvm-HEAD/projects/python_in_a_can/trunk/win32/python-2.7/Lib/urllib2.py   pyvm(Download)
except ImportError:
    from StringIO import StringIO
 
from urllib import (unwrap, unquote, splittype, splithost, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
##        fw.ftp.set_debuglevel(1)
        return fw
 
class CacheFTPHandler(FTPHandler):
    # XXX would be nice to have pluggable cache strategies
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

src/p/y/pyitc-HEAD/mechanize/_urllib2_fork.py   pyitc(Download)
    return None, url
 
 
from urllib import (unwrap, unquote, splittype, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        try:
            fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
        except TypeError:
            # Python < 2.6, no per-connection timeout support
            fw = ftpwrapper(user, passwd, host, port, dirs)
##        fw.ftp.set_debuglevel(1)
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

src/p/y/python2.6-cmake-HEAD/Lib/urllib2.py   python2.6-cmake(Download)
except ImportError:
    from StringIO import StringIO
 
from urllib import (unwrap, unquote, splittype, splithost, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
##        fw.ftp.set_debuglevel(1)
        return fw
 
class CacheFTPHandler(FTPHandler):
    # XXX would be nice to have pluggable cache strategies
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

src/s/t/stackless-HEAD/Lib/urllib2.py   stackless(Download)
except ImportError:
    from StringIO import StringIO
 
from urllib import (unwrap, unquote, splittype, splithost, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
##        fw.ftp.set_debuglevel(1)
        return fw
 
class CacheFTPHandler(FTPHandler):
    # XXX would be nice to have pluggable cache strategies
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

src/s/l/SlopPy-HEAD/Lib/urllib2.py   SlopPy(Download)
except ImportError:
    from StringIO import StringIO
 
from urllib import (unwrap, unquote, splittype, splithost, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
##        fw.ftp.set_debuglevel(1)
        return fw
 
class CacheFTPHandler(FTPHandler):
    # XXX would be nice to have pluggable cache strategies
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

src/i/n/IncPy-HEAD/Lib/urllib2.py   IncPy(Download)
except ImportError:
    from StringIO import StringIO
 
from urllib import (unwrap, unquote, splittype, splithost, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
##        fw.ftp.set_debuglevel(1)
        return fw
 
class CacheFTPHandler(FTPHandler):
    # XXX would be nice to have pluggable cache strategies
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

src/u/n/unladen-swallow-HEAD/Lib/urllib2.py   unladen-swallow(Download)
except ImportError:
    from StringIO import StringIO
 
from urllib import (unwrap, unquote, splittype, splithost, quote,
     addinfourl, splitport,
     splitattr, ftpwrapper, splituser, splitpasswd, splitvalue)
 
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        fw = ftpwrapper(user, passwd, host, port, dirs, timeout)
##        fw.ftp.set_debuglevel(1)
        return fw
 
class CacheFTPHandler(FTPHandler):
    # XXX would be nice to have pluggable cache strategies
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
            self.timeout[key] = time.time() + self.delay

  1 | 2 | 3 | 4 | 5  Next