Changeset 194
- Timestamp:
- 2002-05-26 23:57:13 (7 years ago)
- Files:
-
- trunk/ftputil.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ftputil.txt
r193 r194 166 166 import ftputil 167 167 168 EXAMPLE_PORT = 50001 169 168 170 class MySession(ftplib.FTP): 169 171 def __init__(self, host, userid, password, port): 170 """Act like ftplib.FTP's constructor but connect to port x."""172 """Act like ftplib.FTP's constructor but connect to other port.""" 171 173 ftplib.FTP.__init__(self) 172 174 self.connect(host, port) … … 175 177 # try not to use MySession() as factory, - use the class itself 176 178 host = ftputil.FTPHost(host, userid, password, 177 port= PORT, session_factory=MySession)179 port=EXAMPLE_PORT, session_factory=MySession) 178 180 # use `host` as usual 179 181 -----
