Home | Trees | Index | Help |
|
---|
Package twisted :: Package protocols :: Module ftp :: Class FTP |
|
BaseProtocol
--+ |Protocol
--+ |LineReceiver
--+ |object
--+ |TimeoutMixin
--+ | FTP
Method Summary | |
---|---|
__testingautologin(self)
| |
sets up anonymous login avatar | |
called back when any DTP command has completed successfully | |
sets up authorized user login avatar | |
_createDTP(self)
| |
_doDTPCommand(self,
cmd,
*arg)
| |
_ebDTP(self,
error)
| |
_ebLogin(self,
failure)
| |
_unblock(self,
*_)
| |
call when DTP connection exits | |
connectionLost(self,
reason)
| |
Called when a connection is made. | |
Decode an FTP response specifying a host and port. | |
called back when a file transfer has been completed by the dtp | |
ftp_CDUP(self)
| |
ftp_CWD(self,
params)
| |
This command causes a list to be sent from the server to the passive DTP. | |
ftp_MDTM(self,
params)
| |
ftp_MODE(self,
params)
| |
Authorize the USER and the submitted password from the rfc: The argument field is a Telnet string specifying the user's password. | |
Request for a passive connection reply is in format 227 =h1,h2,h3,h4,p1,p2 from the rfc: This command requests the server-DTP to "listen" on a data port (which is not its default data port) and to wait for a connection rather than initiate one upon receipt of a transfer command. | |
ftp_PORT(self,
params)
| |
Print working directory command | |
ftp_QUIT(self,
params)
| |
ftp_RETR(self,
params)
| |
ftp_SIZE(self,
params)
| |
ftp_STRU(self,
params)
| |
ftp_SYST(self,
params)
| |
ftp_TYPE(self,
params)
| |
Get the login name, and reset the session PASS is expected to follow from the rfc: The argument field is a Telnet string identifying the user. | |
Process the input from the client | |
processCommand(self,
cmd,
*args)
| |
format a RESPONSE and send it out over the wire | |
setTimeout(self,
seconds)
| |
Called when the connection times out. | |
Inherited from object | |
__init__(...)
| |
__delattr__(...)
| |
__getattribute__(...)
| |
__hash__(...)
| |
__reduce__(...)
| |
__repr__(...)
| |
__setattr__(...)
| |
__str__(...)
| |
Inherited from LineReceiver | |
Clear buffered data. | |
Protocol.dataReceived. | |
Called when the maximum line length has been reached. | |
Override this for when raw data is received. | |
Sends a line to the other end of the connection. | |
Sets the line-mode of this receiver. | |
Sets the raw mode of this receiver. | |
Inherited from Protocol | |
(Deprecated) | |
Inherited from BaseProtocol | |
Make a connection to a transport and a server. | |
Inherited from TimeoutMixin | |
Reset the timeout count down | |
Inherited from type | |
__new__(...)
|
Instance Variable Summary | |
---|---|
int |
binary : The transfer mode. |
NoneType |
blocked : Command queue for command pipelining |
NoneType |
dtpFactory : Generates a single DTP for this session |
NoneType |
dtpHostPort : cluient (address, port) to connect to on a PORT command |
NoneType |
dtpInetPort : dtpPort.getHost() |
NoneType |
dtpPort : Port returned from listenTCP |
NoneType |
dtpTxfrMode : The current mode -- PASV or PORT |
NoneType |
peerHost : The (type, ip, port) of the client |
NoneType |
shell : The connected avatar |
NoneType |
user : The username of the connected client |
Class Variable Summary | |
---|---|
tuple |
__implements__ = (<class 'twisted.protocols.ftp.IDTPPare...
|
list |
blockingCommands = ['RETR', 'STOR', 'LIST', 'PORT']
|
NoneType |
dtpInstance = None |
int |
dtpTimeout = 10 |
int |
instanceNum = 0 |
NoneType |
portal = None |
SRE_Pattern |
reTelnetChars = (\\x[0-9a-f]{2})+
|
Inherited from LineReceiver | |
str |
_LineReceiver__buffer = ''
|
str |
delimiter : The line-ending delimiter to use. |
int |
line_mode = 1 |
int |
MAX_LENGTH : The maximum length of a line to allow (If a sent line is longer than
this, the connection is dropped). |
Inherited from BaseProtocol | |
int |
connected = 0 |
NoneType |
transport = None |
Inherited from TimeoutMixin | |
NoneType |
_TimeoutMixin__lastReceived = None |
NoneType |
_TimeoutMixin__timeoutCall = None |
NoneType |
timeOut : The number of seconds after which to timeout the connection. |
Method Details |
---|
_cbAnonLogin(self, (interface, avatar, logout))sets up anonymous login avatar |
_cbDTPCommand(self)called back when any DTP command has completed successfully |
_cbLogin(self, (interface, avatar, logout))sets up authorized user login avatar |
cleanupDTP(self)call when DTP connection exits |
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.
|
decodeHostPort(self, line)Decode an FTP response specifying a host and port. see RFC sec. 4.1.2 "PASV"
|
finishedFileTransfer(self, *arg)called back when a file transfer has been completed by the dtp |
ftp_LIST(self, params='')This command causes a list to be sent from the server to the passive DTP. If the pathname specifies a directory or other group of files, the server should transfer a list of files in the specified directory. If the pathname specifies a file then the server should send current information on the file. A null argument implies the user's current working or default directory. |
ftp_PASS(self, params='')Authorize the USER and the submitted password from the rfc: The argument field is a Telnet string specifying the user's password. This command must be immediately preceded by the user name command, and, for some sites, completes the user's identification for access control. |
ftp_PASV(self)Request for a passive connection reply is in format 227 =h1,h2,h3,h4,p1,p2 from the rfc: This command requests the server-DTP to "listen" on a data port (which is not its default data port) and to wait for a connection rather than initiate one upon receipt of a transfer command. The response to this command includes the host and port address this server is listening on. |
ftp_PWD(self, params='')Print working directory command |
ftp_USER(self, params)Get the login name, and reset the session PASS is expected to follow from the rfc: The argument field is a Telnet string identifying the user. The user identification is that which is required by the server for access to its file system. This command will normally be the first command transmitted by the user after the control connections are made This has the effect of flushing any user, password, and account information already supplied and beginning the login sequence again. All transfer parameters are unchanged and any file transfer in progress is completed under the old access control parameters. |
lineReceived(self, line)Process the input from the client |
reply(self, key, s='')format a RESPONSE and send it out over the wire |
timeoutConnection(self)Called when the connection times out. Override to define behavior other than dropping the connection.
|
Instance Variable Details |
---|
binaryThe transfer mode. If false, ASCII.
|
blockedCommand queue for command pipelining
|
dtpFactoryGenerates a single DTP for this session
|
dtpHostPortcluient (address, port) to connect to on a PORT command
|
dtpInetPortdtpPort.getHost()
|
dtpPortPort returned from listenTCP
|
dtpTxfrModeThe current mode -- PASV or PORT
|
peerHostThe (type, ip, port) of the client
|
shellThe connected avatar
|
userThe username of the connected client
|
Class Variable Details |
---|
__implements__
|
blockingCommands
|
dtpInstance
|
dtpTimeout
|
instanceNum
|
portal
|
reTelnetChars
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:07:58 2004 | http://epydoc.sf.net |