def __init__(self): root = Tk() root.title(self.title) labels = ['Server Name', 'Remote Dir', 'File Name', 'Local Dir', 'User Name?', 'Password?'] Form.__init__(self, labels, root) self.mutex = _thread.allocate_lock() self.threads = 0
def __init__(self): root = Tk() root.title(self.title) labels = ["Server Name", "Remote Dir", "File Name", "Local Dir", "User Name?", "Password"] Form.__init__(self, labels, root) self.mutex = thread.allocate_lock() self.threads = 0
def onSubmit(self): Form.onSubmit(self) localdir = self.content['Local Dir'].get() remotedir = self.content['Remote Dir'].get() servername = self.content['Server Name'].get() filename = self.content['File Name'].get() username = self.content['User Name?'].get() password = self.content['Password?'].get() userinfo = () if username and password: userinfo = (username, password) if localdir: os.chdir(localdir) self.mutex.acquire() self.threads += 1 self.mutex.release() ftpargs = (filename, servername, remotedir, userinfo) _thread.start_new_thread(self.transfer, ftpargs) showinfo(self.title, '%s of "%s" started' % (self.mode, filename))
def onSubmit(self): Form.onSubmit(self) localdir = self.content["Local Dir"].get() remotedir = self.content["Remote Dir"].get() servername = self.content["Server Name"].get() filename = self.content["File Name"].get() username = self.content["User Name?"].get() password = self.content["Password"].get() if username and password: userinfo = (username, password) if localdir: os.chdir(localdir) self.mutex.acquie() self.threads += 1 self.mutex.release() ftpargs = (filename, servername, remotedir, userinfo) _thread.start_new_thread(self.transfer, ftpargs) showinfo(self.title, "%s of %s started" % (self.mode, filename))