def __init__(self, destinationFile=None, mirror=None): QFtp.__init__(self) # TODO: or parent? solve this. self.updateProxy() self.mirror = mirror self.filePath = destinationFile self.downloading = False QtCore.QObject.connect(self, QtCore.SIGNAL('commandFinished(int,bool)'), self.logCommandFinished) QtCore.QObject.connect(self, QtCore.SIGNAL('stateChanged(int)'), self.logChangeState) QtCore.QObject.connect(self, QtCore.SIGNAL('done(bool)'), self.processDone) QtCore.QObject.connect(self, QtCore.SIGNAL('dataTransferProgress(qint64,qint64)'), self.traceTransferProgress) QtCore.QObject.connect(self, QtCore.SIGNAL('readyRead()'), self.writeBack)
def __init__( self, parent=None ): # ------------------------------------------------------------------- QFtp.__init__( self, parent ); # ------------------------------------------------------------------- self.PARENT = parent; self.DEBUG = False; self.LOG_TAG = str(self.__class__.__name__).upper(); # ------------------------------------------------------------------- self.stateChanged.connect( self.ON_STATE_CHANGED ); self.listInfo.connect( self.ON_LIST_INFO_AVAILABLE ); self.commandFinished.connect( self.ON_COMMAND_FINISHED ); self.commandStarted.connect( self.ON_COMMAND_STARTED ); self.readyRead.connect( self.ON_READY_READ ); self.done.connect( self.ON_DONE ); self.dataTransferProgress.connect( self.ON_DATA_TRANSFER_PROGRESS ); self.rawCommandReply.connect( self.ON_RAW_COMMAND_REPLY ); # ------------------------------------------------------------------- self.HOST = ""; self.PATH = ""; self.USER = ""; self.PWD = ""; self.PORT = 21; # ------------------------------------------------------------------- self.FILE_INFO_LIST = []; self.LOGIN_SUCCESS = False; self.ALLOW_TO_RUN = True; self.LAST_ERROR = QFtp.NoError; self.NEW_URL = ""; self.SHOW_HIDDEN_FILES = False; self.SHOW_FILES_FIRST = False; self.PRINT_CONN_INFO = False; # ------------------------------------------------------------------- self.REQ_UIDS = { "connect" : 0, "login" : 0, "cd" : 0, "list" : 0, } # ------------------------------------------------------------------- self.PARENT.SPLASH.STATUS( self.LOG_TAG+": [INIT]" );
def __init__(self, destinationFile=None, mirror=None): QFtp.__init__(self) # TODO: or parent? solve this. self.updateProxy() self.mirror = mirror self.filePath = destinationFile self.downloading = False QtCore.QObject.connect(self, QtCore.SIGNAL('commandFinished(int,bool)'), self.logCommandFinished) QtCore.QObject.connect(self, QtCore.SIGNAL('stateChanged(int)'), self.logChangeState) QtCore.QObject.connect(self, QtCore.SIGNAL('done(bool)'), self.processDone) QtCore.QObject.connect( self, QtCore.SIGNAL('dataTransferProgress(qint64,qint64)'), self.traceTransferProgress) QtCore.QObject.connect(self, QtCore.SIGNAL('readyRead()'), self.writeBack)