Home | Trees | Index | Help |
|
---|
Package twisted :: Package protocols :: Module irc :: Class DccFileReceive |
|
Ephemeral
--+ |BaseProtocol
--+ | | |Protocol
--+ |DccFileReceiveBasic
--+ | DccFileReceive
Higher-level coverage for getting a file from DCC SEND.
I allow you to change the file's name and destination directory. I won't overwrite an existing file unless I've been told it's okay to do so. If passed the resumeOffset keyword argument I will attempt to resume the file from that amount of bytes.
XXX: I need to let the client know when I am finished. XXX: I need to decide how to keep a progress indicator updated. XXX: Client needs a way to tell me "Do not finish until I say so." XXX: I need to make sure the client understands if the file cannot be written.Method Summary | |
---|---|
__init__(self,
filename,
fileSize,
queryData,
destDir,
resumeOffset)
| |
__repr__(self)
| |
__str__(self)
| |
When the connection is lost, I close the file. | |
Called when a connection is made. | |
Called when data is received. | |
Set the directory where the downloaded file will be placed. | |
Change the name of the file being transferred. | |
May I overwrite existing files? | |
Inherited from Protocol | |
(Deprecated) | |
Inherited from BaseProtocol | |
Make a connection to a transport and a server. | |
Inherited from Ephemeral | |
| |
|
Class Variable Summary | |
---|---|
str |
destDir = '.'
|
str |
filename = 'dcc'
|
int |
fileSize = -1 |
NoneType |
fromUser = None |
int |
overwrite = 0 |
NoneType |
queryData = None |
Inherited from DccFileReceiveBasic | |
int |
bytesReceived = 0 |
Inherited from Protocol | |
tuple |
__implements__ = (<class twisted.internet.interfaces.IPr...
|
Inherited from BaseProtocol | |
int |
connected = 0 |
NoneType |
transport = None |
Method Details |
---|
connectionLost(self, reason)When the connection is lost, I close the file. |
connectionMade(self)Called when a connection is made. This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.
|
dataReceived(self, data)Called when data is received. Warning: This just acknowledges to the remote host that the data has been received; it doesn't *do* anything with the data, so you'll want to override this.
|
set_directory(self, directory)Set the directory where the downloaded file will be placed. May raise OSError if the supplied directory path is not suitable. |
set_filename(self, filename)Change the name of the file being transferred. This replaces the file name provided by the sender. |
set_overwrite(self, boolean)May I overwrite existing files? |
Class Variable Details |
---|
destDir
|
filename
|
fileSize
|
fromUser
|
overwrite
|
queryData
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:08:56 2004 | http://epydoc.sf.net |