def setUp(self): ftp = FTPFactory().GetFTP() #self.fileList = FileTableFactory(ftp).New() self.info = [(u'/me.jpg', 6131)] self.getor = NewGetor(ftp, r'/.*?[^/]{1}$') #self.fileList.Attach(self.getor) pass
def setUp(self): self.CreateFtpInfo() ftp = FTPFactory().GetFTP() self.fileList = FileTableFactory(ftp).New() self.fileList.Attach(NewGetor(ftp, "abc")) c = 0 l = _threading.activeCount() #while c != l: # c = l # sleep(1) # l = _threading.activeCount() sleep(2) self.maxDiff = None
def NewMain(sysList): ftp = FTPFactory().GetFTP() nd = NewDownload(ftp, *sysList) nd.Join()
def main(filenameList): lock = _threading.Lock() # 获取线程锁,预防多个listener竞争lftp的使用 ftp = FTPFactory().GetFTP() downloader = Downloader(ftp, lock, *filenameList) downloader.Run()
def setUp(self): self.listen = Listener(FTPFactory().GetFTP(), '/') self.observer = Observer() self.listen.Attach(self.observer)