Home | Trees | Index | Help |
|
---|
Package twisted :: Package protocols :: Module ftp :: Class FTPFileListProtocol |
|
BaseProtocol
--+ |Protocol
--+ |LineReceiver
--+ | FTPFileListProtocol
Parser for standard FTP file listings
This is the evil required to match:-rw-r--r-- 1 root other 531 Jan 29 03:26 README
If you need different evil for a wacky FTP server, you can override
either fileLinePattern
or
parseDirectoryLine()
.
Method Summary | |
---|---|
__init__(self)
| |
Append file information dictionary to the list of known files. | |
Override this for when each line is received. | |
Return a dictionary of fields, or None if line cannot be parsed. | |
Deal with received lines which could not be parsed as file information. | |
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) | |
Called when the connection is shut down. | |
Inherited from BaseProtocol | |
Called when a connection is made. | |
Make a connection to a transport and a server. |
Instance Variable Summary | |
---|---|
files : list of dicts describing the files in this listing |
Class Variable Summary | |
---|---|
str |
delimiter : The line-ending delimiter to use. |
SRE_Pattern |
fileLinePattern = ^(.)(.{9})\s+(\d*)\s*(\S+)\s+(\S+)\s+(...
|
Inherited from LineReceiver | |
str |
_LineReceiver__buffer = ''
|
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 Protocol | |
tuple |
__implements__ = (<class twisted.internet.interfaces.IPr...
|
Inherited from BaseProtocol | |
int |
connected = 0 |
NoneType |
transport = None |
Method Details |
---|
addFile(self, info)Append file information dictionary to the list of known files. Subclasses can override or extend this method to handle file information differently without affecting the parsing of data from the server.
|
lineReceived(self, line)Override this for when each line is received.
|
parseDirectoryLine(self, line)Return a dictionary of fields, or None if line cannot be parsed.
|
unknownLine(self, line)Deal with received lines which could not be parsed as file information. Subclasses can override this to perform any special processing needed.
|
Instance Variable Details |
---|
fileslist of dicts describing the files in this listing |
Class Variable Details |
---|
delimiterThe line-ending delimiter to use. By default this is '\r\n'.
|
fileLinePattern
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:07:39 2004 | http://epydoc.sf.net |