Package ts3widgets :: Module filetransfer :: Class FileTransferModel
[hide private]
[frames] | no frames]

Class FileTransferModel

source code

PythonQt.QtCore.QAbstractItemModel --+
                                     |
                        object --+   |
                                 |   |
               pytson.Translatable --+
                                     |
                                    FileTransferModel

Itemmodel to abstract multiple filetransfers.

Instance Methods [hide private]
 
__init__(self, schid, cid, password, parent=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__del__(self) source code
 
timerEvent(self, event) source code
int
addDownload(self, thefile, downloaddir, overwrite, resume)
Requests a download from the server and monitors its progress
source code
int
addUpload(self, path, localfile, overwrite, resume)
Requests an upload to the server.
source code
 
cleanup(self)
Cleanup finished and broken downloads
source code
 
onFileTransferStatusEvent(self, transferID, status, statusMessage, remotefileSize, schid) source code
 
onServerErrorEvent(self, schid, errorMessage, error, returnCode, extraMessage) source code
 
onServerPermissionErrorEvent(self, *args) source code
 
headerData(self, section, orientation, role=Qt.DisplayRole) source code
 
index(self, row, column, parent=QModelIndex()) source code
 
parent(self, idx) source code
 
rowCount(self, parent=QModelIndex()) source code
 
columnCount(self, parent=QModelIndex()) source code
 
data(self, idx, role=Qt.DisplayRole) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from pytson.Translatable (private): _tr

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, schid, cid, password, parent=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

addDownload(self, thefile, downloaddir, overwrite, resume)

source code 

Requests a download from the server and monitors its progress

Parameters:
  • thefile (File) - remote file to download
  • downloaddir (str) - path to the download directory
  • overwrite (bool) - set to True to overwrite an existing file
  • resume (bool) - set to True to resume a previous download
Returns: int
the filetransfer id

addUpload(self, path, localfile, overwrite, resume)

source code 

Requests an upload to the server.

Parameters:
  • path (str) - path to upload the file to
  • localfile (str) - path to the file to upload
  • overwrite (bool) - set to True to overwrite an existing file
  • resume (bool) - set to True to resume a previous upload
Returns: int
the filetransfer id