not compressed def connectftp(self)print('connecting 'connection ftplib ftp(self remotesiteconnect to ftp site connection login(self remoteuserself remotepasslog in as user/pswd connection cwd(self remotedircd to dir to xfer if self nonpassiveforce active mode connection set_pasv(falsemost do passive self connection connection def cleanlocals(self)""try to delete all local files first to remove garbage ""if self cleanallfor localname in os listdir(self localdir)local dirlisting trylocal file delete print('deleting local'localnameos remove(os path join(self localdirlocalname)exceptprint('cannot delete local'localnamedef cleanremotes(self)""try to delete all remote files first to remove garbage ""if self cleanallfor remotename in self connection nlst()remote dir listing tryremote file delete print('deleting remote'remotenameself connection delete(remotenameexceptprint('cannot delete remote'remotenamedef downloadone(selfremotenamelocalpath)""download one file by ftp in text or binary mode local name need not be same as remote name ""if self istextkind(remotename)localfile open(localpath' 'encoding=self connection encodingdef callback(line)localfile write(line '\ 'self connection retrlines('retr remotenamecallbackelselocalfile open(localpath'wb'self connection retrbinary('retr remotenamelocalfile writelocalfile close(def uploadone(selflocalnamelocalpathremotename)""upload one file by ftp in text or binary mode remote name need not be same as local name ""if self istextkind(localname) client-side scripting