N
u9c       sd    d  Z  " % k Z & k Z ' k Z * y + k Z e Z Wn , e j
 o - k Z n X1 d Z 5 d Z 9 d Z	 : d Z
 ; d Z < d Z A e	 e
 e e e i e e f Z F d Z J d f  d	     YZ e Z d
   Z d   Z d   Z d   Z  d d d  Z 3d f  d     YZ d   Z e d j o e   n d S(   s  An FTP client class, and some helper functions.
Based on RFC 959: File Transfer Protocol
(FTP), by J. Postel and J. Reynolds

Changes and improvements suggested by Steve Majewski.
Modified by Jack to work on the mac.
Modified by Siebren to support docstrings and PASV.


Example:

>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd user@hostname
'230 Guest login ok, access restrictions apply.'
>>> ftp.retrlines('LIST') # list directory contents
total 9
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
-rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
'226 Transfer complete.'
>>> ftp.quit()
'221 Goodbye.'
>>> 

A nice test that reveals some of the network dialogue would be:
python ftplib.py -d localhost -l -p -l
i   i   s   ftplib.error_replys   ftplib.error_temps   ftplib.error_perms   ftplib.error_protos   
s   FTPc      s  J d  Z  Z ` d d d d d  Z m d d d  Z z d   Z  d   Z  e Z  d   Z  d   Z  d	   Z  d
   Z	  d   Z
  d   Z  d   Z  d   Z  d   Z  d   Z  d   Z  d   Z  d   Z  d   Z d   Z d d d d  Z Bd d  Z Qe d  Z id   Z td   Z d   Z d   Z d   Z d   Z d    Z d!   Z  d"   Z! d#   Z" d$   Z# d%   Z$ d&   Z% d'   Z& RS((   s;  An FTP client class.

	To create a connection, call the class using these argument:
		host, user, passwd, acct
	These are all strings, and have default value ''.
	Then use self.connect() with optional host and port argument.

	To download a file, use ftp.retrlines('RETR ' + filename),
	or ftp.retrbinary() with slightly different arguments.
	To upload a file, use ftp.storlines() or ftp.storbinary(),
	which have an open file as argument (see their definitions
	below for details).
	The download/upload functions first issue appropriate TYPE
	and PORT or PASV commands.
c    s   ` b d |  _ c d |  _ d t |  _ e t |  _ f t |  _ g t |  _ h t } i | o< j |  i
 |  } k | o k |  i | | |  } n n d  S(   Ni    s    (   s   selfs	   debuggings   hosts   FTP_PORTs   ports   Nones   socks   files   welcomes   resps   connects   users   logins   passwds   acct(   s   selfs   hosts   users   passwds   accts   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   __init__` s   	

 s    c    s   m p q | o q | |  _  n r | o r | |  _ n s d |  _ t t i t i t i  |  _ u |  i i |  i  |  i  v |  i i	 d  |  _
 w |  i   |  _ x |  i Sd S(   s   Connect to host.  Arguments are:
		- host: hostname to connect to (string, default previous host)
		- port: port to connect to (integer, default previous port)i    s   rbN(   s   hosts   selfs   ports   passiveservers   sockets   AF_INETs   SOCK_STREAMs   socks   connects   makefiles   files   getresps   welcome(   s   selfs   hosts   ports*   /usr/lib/python1.5/site-packages/ftplib.pys   connectm s   
 
 i    c    s=   z | } |  i o ~ d G|  i |  i  GHn  |  i Sd S(   sZ   Get the welcome message from the server.
		(this is read and squirreled away by connect())s	   *welcome*N(   s   selfs	   debuggings   sanitizes   welcome(   s   selfs*   /usr/lib/python1.5/site-packages/ftplib.pys
   getwelcomez s   c    s      | |  _ d S(   s   Set the debugging level.
		The required argument level means:
		0: no debugging output (default)
		1: print commands and responses but not body text etc.
		2: also print raw lines read and sent before stripping CR/LFN(   s   levels   selfs	   debugging(   s   selfs   levels*   /usr/lib/python1.5/site-packages/ftplib.pys   set_debuglevel s   c    s      | |  _ d S(   s   Use passive or active mode for data transfers.
		With a false argument, use the normal PORT mode,
		With a true argument, use the PASV command.N(   s   vals   selfs   passiveserver(   s   selfs   vals*   /usr/lib/python1.5/site-packages/ftplib.pys   set_pasv s   c    s     | d  d j p | d  d j oq  t |  }  x7  | d j o | | d d j o  | d } q= W | d  d | d | | } n  | Sd  S(   Ni   s   pass s   PASS i   s   
s   *(   s   ss   lens   i(   s   selfs   ss   is*   /usr/lib/python1.5/site-packages/ftplib.pys   sanitize s   % %%c    sS     | t }  |  i d j o  d G|  i |  GHn  |  i i |  d  S(   Ni   s   *put*(   s   lines   CRLFs   selfs	   debuggings   sanitizes   socks   send(   s   selfs   lines*   /usr/lib/python1.5/site-packages/ftplib.pys   putline s    c    s=     |  i o  d G|  i |  GHn  |  i |  d  S(   Ns   *cmd*(   s   selfs	   debuggings   sanitizes   lines   putline(   s   selfs   lines*   /usr/lib/python1.5/site-packages/ftplib.pys   putcmd s    c    s     |  i i   }  |  i d j o  d G|  i |  GHn  | o  t  n  | d t j o  | d  } n(  | d t j o  | d  } n  | Sd  S(   Ni   s   *get*i   (   s   selfs   files   readlines   lines	   debuggings   sanitizes   EOFErrors   CRLF(   s   selfs   lines*   /usr/lib/python1.5/site-packages/ftplib.pys   getline s      c    s     |  i   }  | d d !d j ov  | d  }  x_  d oT  |  i   }  | d | }  | d  | j o | d d !d j o  Pn q< Wn  | Sd  S(   Ni   i   s   -i   s   
(   s   selfs   getlines   lines   codes   nextline(   s   selfs   lines   codes   nextlines*   /usr/lib/python1.5/site-packages/ftplib.pys   getmultiline s    
(c    s     |  i   }  |  i o  d G|  i |  GHn  | d  |  _  | d  }  | d j o  t |  n  | d j o  t |  n  | d j o  t	 |  n  | Sd  S(   Ns   *resp*i   i   s   4s   5s   123(
   s   selfs   getmultilines   resps	   debuggings   sanitizes   lastresps   cs
   error_temps
   error_perms   error_proto(   s   selfs   resps   cs*   /usr/lib/python1.5/site-packages/ftplib.pys   getresp s    c    sD      |  i   }  | d d j o  t |  n  | Sd S(   s%   Expect a response beginning with '2'.i    s   2N(   s   selfs   getresps   resps   error_reply(   s   selfs   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   voidresp s
   c    s      d t  }  |  i d j o  d G|  i |  GHn  |  i i | t   |  i   }  | d  d d f j o  t
 |  n d S(   s   Abort a file transfer.  Uses out-of-band data.
		This does not follow the procedure from the RFC to send Telnet
		IP and Synch; that doesn't seem to work with the servers I've
		tried.  Instead, just send the ABOR command as OOB data.s   ABORi   s   *put urgent*i   s   426s   226N(   s   CRLFs   lines   selfs	   debuggings   sanitizes   socks   sends   MSG_OOBs   getmultilines   resps   error_proto(   s   selfs   lines   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   abort s    c    s'      |  i |   |  i   Sd S(   s'   Send a command and return the response.N(   s   selfs   putcmds   cmds   getresp(   s   selfs   cmds*   /usr/lib/python1.5/site-packages/ftplib.pys   sendcmd s   c    s'      |  i |   |  i   Sd S(   s8   Send a command and expect a response beginning with '2'.N(   s   selfs   putcmds   cmds   voidresp(   s   selfs   cmds*   /usr/lib/python1.5/site-packages/ftplib.pys   voidcmd s   c    sn      t  i | d  }  | d | d g }  | | }  d t  i | d  }  |  i
 |  Sd S(   sD   Send a PORT command with the current host and the given port number.s   .i   s   PORT s   ,N(   s   strings   splitfieldss   hosts   hbytess   ports   pbytess   bytess
   joinfieldss   cmds   selfs   voidcmd(   s   selfs   hosts   ports   hbytess   pbytess   bytess   cmds*   /usr/lib/python1.5/site-packages/ftplib.pys   sendport s   c    s       t  i  t  i t  i  }  | i d d f   | i d   | i   \ } }  |  i i   \ } }  |  i | |  }  | Sd S(   s3   Create a new socket and send a PORT command for it.s    i    i   N(   s   sockets   AF_INETs   SOCK_STREAMs   socks   binds   listens   getsocknames	   dummyhosts   ports   selfs   hosts	   dummyports   sendports   resp(   s   selfs   socks	   dummyhosts   ports   hosts	   dummyports   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   makeport s   c 	   s4   t  } |  i o 	t |  i d   \ } } 
t i t i	 t i
  } | i | |  |  i |  } | d d j o t |  n n[ |  i   } |  i |  } | d d j o t |  n | i   \ } } | d  d j o t |  } n | | f Sd S(   s  Initiate a transfer over the data connection.
		If the transfer is active, send a port command and
		the transfer command, and accept the connection.
		If the server is passive, send a pasv command, connect
		to it, and start the transfer command.
		Either way, return the socket for the connection and
		the expected size of the transfer.  The expected size
		may be None if it could not be determined.s   PASVi    s   1i   s   150N(   s   Nones   sizes   selfs   passiveservers   parse227s   sendcmds   hosts   ports   sockets   AF_INETs   SOCK_STREAMs   conns   connects   cmds   resps   error_replys   makeports   socks   accepts   sockaddrs   parse150(	   s   selfs   cmds   sizes   hosts   ports   conns   resps   socks   sockaddrs*   /usr/lib/python1.5/site-packages/ftplib.pys   ntransfercmd s"   	c    s   |  i |  d Sd S(   sq   Initiate a transfer over the data connection.  Returns
		the socket for the connection.  See also ntransfercmd().i    N(   s   selfs   ntransfercmds   cmd(   s   selfs   cmds*   /usr/lib/python1.5/site-packages/ftplib.pys   transfercmds   c    sO   !| o !d } n "| o "d } n #| o #d } n $| d j o | d d f j o=%t i   } 'd | j o~ (t i |  } )t i |  \ } } } +| i d |  ,x4 | d ,r' }	 -d |	 j o .|	 } /Pn q Wn 0ya 1t i i d  o 2t i d }
 n4 3t i i d  o 4t i d }
 n
 6d }
 Wn 7t j
 o 9d }
 n X:| |
 d | } n ;|  i d	 |  } <| d d
 j o <|  i d |  } n =| d d
 j o =|  i d |  } n >| d d j o ?t |  n @| Sd S(   s   Login, default anonymous.s	   anonymouss    s   -s   .i    s   LOGNAMEs   USERs   @s   USER s   3s   PASS s   ACCT s   2N(   s   users   passwds   accts   sockets   gethostnames   thishosts   gethostbynames   thisaddrs   gethostbyaddrs	   firstnames   namess   unuseds   inserts   names   oss   environs   has_keys   realusers   AttributeErrors   selfs   sendcmds   resps   error_reply(   s   selfs   users   passwds   accts   thishosts   thisaddrs	   firstnames   namess   unuseds   names   realusers   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   loginsF      # 		  c    s   BFG|  i d  H|  i |  } IxA Id o6 J| i |  } K| o LPn M| |  q. WN| i	   O|  i
   Sd S(   s   Retrieve data in binary mode.
		The argument is a RETR command.
		The callback function is called for each block.
		This creates a new port for yous   TYPE Ii   N(   s   selfs   voidcmds   transfercmds   cmds   conns   recvs	   blocksizes   datas   callbacks   closes   voidresp(   s   selfs   cmds   callbacks	   blocksizes   conns   datas*   /usr/lib/python1.5/site-packages/ftplib.pys
   retrbinaryBs    
i    c    s5  QVW| o Wt } n X|  i d  } Y|  i |  } Z| i d  } [x [d o \| i
   } ]|  i d j o ]d G| GHn ^| o _Pn `| d t j o a| d  } n( b| d d j o c| d  } n d| |  qZ We| i   f| i   g|  i   Sd S(   s   Retrieve data in line mode.
		The argument is a RETR or LIST command.
		The callback function (2nd argument) is called for each line,
		with trailing CRLF stripped.  This creates a new port for you.
		print_lines is the default callback.s   TYPE As   rbi   i   s   *retr*s   
N(   s   callbacks
   print_lines   selfs   sendcmds   resps   transfercmds   cmds   conns   makefiles   fps   readlines   lines	   debuggings   CRLFs   closes   voidresp(   s   selfs   cmds   callbacks   resps   conns   fps   lines*   /usr/lib/python1.5/site-packages/ftplib.pys	   retrlinesQs*     
 c    s   ijk|  i d  l|  i |  } mxD md o9 n| i |  } o| o oPn p| i	 |  q. Wq| i
   r|  i   Sd S(   s   Store a file in binary mode.s   TYPE Ii   N(   s   selfs   voidcmds   transfercmds   cmds   conns   fps   reads	   blocksizes   bufs   sends   closes   voidresp(   s   selfs   cmds   fps	   blocksizes   conns   bufs*   /usr/lib/python1.5/site-packages/ftplib.pys
   storbinaryis    
 c    s   tuv|  i d  w|  i |  } xx xd o y| i   } z| o zPn {| d t j o8 || d t j o || d  } n }| t } n ~| i	 |  q. W| i
   |  i   Sd S(   s   Store a file in line mode.s   TYPE Ai   i   N(   s   selfs   voidcmds   transfercmds   cmds   conns   fps   readlines   bufs   CRLFs   sends   closes   voidresp(   s   selfs   cmds   fps   conns   bufs*   /usr/lib/python1.5/site-packages/ftplib.pys	   storlinests    
  c    s'   d | } |  i |  Sd S(   s   Send new account name.s   ACCT N(   s   passwords   cmds   selfs   voidcmd(   s   selfs   passwords   cmds*   /usr/lib/python1.5/site-packages/ftplib.pys   accts   c    sc   d } x$ | d r } | d | } q Wg  } |  i | | i  | Sd S(   sB   Return a list of files in a given directory (default the current).s   NLSTi    s    N(   s   cmds   argss   args   filess   selfs	   retrliness   append(   s   selfs   argss   cmds   args   filess*   /usr/lib/python1.5/site-packages/ftplib.pys   nlsts   	 		c    s   d } t } | d o t | d  t d  j o# | d  | d f \ } } n x2 | d r% } | o | d | } n qt W|  i | |  d S(   s   List a directory in long form.
		By default list current directory to stdout.
		Optional last argument is callback function; all
		non-empty arguments before it are concatenated to the
		LIST command.  (This *should* only be used for a pathname.)s   LISTi   s    i    s    N(   s   cmds   Nones   funcs   argss   types   args   selfs	   retrlines(   s   selfs   argss   cmds   funcs   args*   /usr/lib/python1.5/site-packages/ftplib.pys   dirs   		-# 	
c    sX   |  i d |  } | d d j o t |  n |  i d |  Sd S(   s   Rename a file.s   RNFR i    s   3s   RNTO N(   s   selfs   sendcmds   fromnames   resps   error_replys   voidcmds   toname(   s   selfs   fromnames   tonames   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   renames
   c    su   |  i d |  } | d  d d f j o | Sn1 | d  d j o t |  n t |  d S(   s   Delete a file.s   DELE i   s   250s   200i   s   5N(   s   selfs   sendcmds   filenames   resps
   error_perms   error_reply(   s   selfs   filenames   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   deletes   c    s   | d j oZ y |  i d  SWn< t j
 o- } | d  d j o t |  n n Xn d | } |  i |  Sd S(   s   Change to a directory.s   ..s   CDUPi   s   500s   CWD N(   s   dirnames   selfs   voidcmds
   error_perms   msgs   cmd(   s   selfs   dirnames   msgs   cmds*   /usr/lib/python1.5/site-packages/ftplib.pys   cwds   c    sU   |  i d |  } | d  d j o! t i t i | d   Sn d S(   s   Retrieve the size of a file.s   SIZE i   s   213N(   s   selfs   sendcmds   filenames   resps   strings   atois   strip(   s   selfs   filenames   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   sizes   c    s-   |  i d |  } t |  Sd S(   s+   Make a directory, return its full pathname.s   MKD N(   s   selfs   sendcmds   dirnames   resps   parse257(   s   selfs   dirnames   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   mkds   c    s   |  i d |  Sd S(   s   Remove a directory.s   RMD N(   s   selfs   voidcmds   dirname(   s   selfs   dirnames*   /usr/lib/python1.5/site-packages/ftplib.pys   rmds   c    s)   |  i d  } t |  Sd S(   s!   Return current working directory.s   PWDN(   s   selfs   sendcmds   resps   parse257(   s   selfs   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   pwds   c    s0   |  i d  } |  i   | Sd S(   s   Quit, and close the connection.s   QUITN(   s   selfs   voidcmds   resps   close(   s   selfs   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   quits   c    s9   |  i i   |  i i   |  ` |  ` d S(   s8   Close the connection without assuming anything about it.N(   s   selfs   files   closes   sock(   s   selfs*   /usr/lib/python1.5/site-packages/ftplib.pys   closes   ('   s   __doc__s   __init__s   connects
   getwelcomes   set_debuglevels   debugs   set_pasvs   sanitizes   putlines   putcmds   getlines   getmultilines   getresps   voidresps   aborts   sendcmds   voidcmds   sendports   makeports   ntransfercmds   transfercmds   logins
   retrbinarys   Nones	   retrliness
   storbinarys	   storliness   accts   nlsts   dirs   renames   deletes   cwds   sizes   mkds   rmds   pwds   quits   close(    s*   /usr/lib/python1.5/site-packages/ftplib.pys   FTPJ sL   			#	
c    s   |  d  d j o t |   n t t j o% k } | i d | i  a n t i |   } | o t	 i
 | i d   Sn t Sd S(   s   Parse the '150' response for a RETR request.
	Returns the expected transfer size or None; size is not guaranteed to
	be present in the 150 message.
	i   s   150s   150 .* \((\d+) bytes\)i   N(   s   resps   error_replys   _150_res   Nones   res   compiles
   IGNORECASEs   matchs   ms   strings   atois   group(   s   resps   res   ms*   /usr/lib/python1.5/site-packages/ftplib.pys   parse150s   	
c    s6  |  d  d j o t |   n t i |  d  } | d j  o t |   n t i |  d | d  } | d j  o t |   n t i |  | d | !d  } t	 |  d j o t |   n t i
 | d	  d
  }  t i | d	  d >t i | d  } | | f Sd S(   s   Parse the '227' response for a PASV request.
	Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
	Return ('host.addr.as.numbers', port#) tuple.i   s   227s   (i    s   )i   s   ,i   i   s   .i   i   N(   s   resps   error_replys   strings   finds   lefts   error_protos   rights   splits   numberss   lens   joins   hosts   atois   port(   s   resps   lefts   rights   numberss   hosts   ports*   /usr/lib/python1.5/site-packages/ftplib.pys   parse227s     +c    s  	|  d  d j o 
t |   n |  d d !d j o d Sn d } d } t |   } x | | j  ou |  | } | d } | d j o: | | j p |  | d j o Pn | d } n | | } qs W| Sd S(	   s   Parse the '257' response for a MKD or PWD request.
	This is a response to a MKD or PWD request: a directory name.
	Returns the directoryname in the 257 reply.i   s   257i   s    "s    i   s   "N(   s   resps   error_replys   dirnames   is   lens   ns   c(   s   resps   dirnames   is   ns   cs*   /usr/lib/python1.5/site-packages/ftplib.pys   parse257s$   		 !c    s   |  GHd S(   s+   Default retrlines callback to print a line.N(   s   line(   s   lines*   /usr/lib/python1.5/site-packages/ftplib.pys
   print_lines   c 	   s   !"| o "| } n #d | } $|  i |  %| i |  &t |  i d   \ } } '| i
 | |  +| i d |  } ,| d  d d f j o ,t  n -|  i d |  } .| d  d d f j o .t  n /|  i   0| i   d S(	   s+   Copy file from one FTP-instance to another.s   TYPE s   PASVs   STOR i   s   125s   150s   RETR N(   s
   targetnames
   sourcenames   types   sources   voidcmds   targets   parse227s   sendcmds
   sourcehosts
   sourceports   sendports   treplys   error_protos   sreplys   voidresp(	   s   sources
   sourcenames   targets
   targetnames   types
   sourcehosts
   sourceports   treplys   sreplys*   /usr/lib/python1.5/site-packages/ftplib.pys   ftpcp s       s    s   Is   Netrcc      sh   3d  Z  :;e Z <e Z =e Z ?e d  Z d   Z d   Z d   Z d   Z	 RS(   s   Class to parse & provide access to 'netrc' format files.

	See the netrc(4) man page for information on the file format.

	WARNING: This class is obsolete -- use module netrc instead.

	c    s  ?@| oL At i i d  o& Bt i i t i d Cd  } n Et d  n Gh  |  _ Hh  |  _	 It
 | d  } Jd } Kx<Kd o1L| i   } M| o MPn N| o t i |  o O| i |  Pq n. Q| o# Rt |  |  i	 | <Sd } n Tt i |  } Ut } } } }	 Vd }
 Wd } XxX| t |  j  ozY| | } Z| d t |  j  o [| | d } n
 ]t } ^| d j o _d }
 n`| d j o | o# at i! |  } b| d } n c| d	 j o | o d| } e| d } n f| d
 j o | o g| } h| d } nl i| d j o | o j| }	 k| d } n; l| d j o | o# m| } ng  } od } pPn q| d } q_Wr|
 oF s| p |  i" |  _" t| p |  i# |  _# u|	 p |  i$ |  _$ n v| o w|  i i |  oM x|  i | \ } } } z| p | } {| p | } ||	 p | }	 n }| | |	 f |  i | <n q W~| i(   d  S(   Ns   HOMEs   .netrcs!   specify file to load or set $HOMEs   ri    i   s   defaults   machines   logins   passwords   accounts   macdef()   s   filenames   oss   environs   has_keys   paths   joins   IOErrors   selfs   _Netrc__hostss   _Netrc__macross   opens   fps   in_macros   readlines   lines   strings   strips   macro_liness   appends   tuples
   macro_names   splits   wordss   Nones   hosts   users   passwds   accts   defaults   is   lens   w1s   w2s   lowers   _Netrc__defusers   _Netrc__defpasswds   _Netrc__defaccts   ousers   opasswds   oaccts   close(   s   selfs   filenames   fps   in_macros   lines   wordss   hosts   users   passwds   accts   defaults   is   w1s   w2s
   macro_names   macro_liness   ousers   opasswds   oaccts*   /usr/lib/python1.5/site-packages/ftplib.pys   __init__?s|   	 
 

		 							

"c    s   |  i i   Sd S(   s4   Return a list of hosts mentioned in the .netrc file.N(   s   selfs   _Netrc__hostss   keys(   s   selfs*   /usr/lib/python1.5/site-packages/ftplib.pys	   get_hostss   c    s   t  i |  } t } } } |  i i	 |  o |  i | \ } } } n | p |  i
 } | p |  i } | p |  i } | | | f Sd S(   s   Returns login information for the named host.

		The return value is a triple containing userid,
		password, and the accounting field.

		N(   s   strings   lowers   hosts   Nones   users   passwds   accts   selfs   _Netrc__hostss   has_keys   _Netrc__defusers   _Netrc__defpasswds   _Netrc__defacct(   s   selfs   hosts   users   passwds   accts*   /usr/lib/python1.5/site-packages/ftplib.pys   get_accounts   c    s   |  i i   Sd S(   s)   Return a list of all defined macro names.N(   s   selfs   _Netrc__macross   keys(   s   selfs*   /usr/lib/python1.5/site-packages/ftplib.pys
   get_macross   c    s   |  i | Sd S(   s6   Return a sequence of lines which define a named macro.N(   s   selfs   _Netrc__macross   macro(   s   selfs   macros*   /usr/lib/python1.5/site-packages/ftplib.pys	   get_macros   (
   s   __doc__s   Nones   _Netrc__defusers   _Netrc__defpasswds   _Netrc__defaccts   __init__s	   get_hostss   get_accounts
   get_macross	   get_macro(    s*   /usr/lib/python1.5/site-packages/ftplib.pys   Netrc3s   				Ac     s  d }  t } x6 t i d d j o |  d }  t i d =q Wt i d d  d j o% t i d d } t i d =n t i d } t |  } | i |   d } } } y t |  } Wn= t j
 o. | t j	 o t i i d  n nP Xy | i |  \ } } } Wn) t j
 o t i i d  n X| i | | |  x t i d d r } | d  d	 j o | i | d  n | d  d j oF d
 }	 | d o |	 d | d }	 n | i |	  }
 nL | d j o | i | i  n$ | i d | t i i d  qW| i   d S(   sR   Test program.
	Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...i    i   s   -di   s   -rs    s5   Could not open account file -- using anonymous login.s$   No account -- using anonymous login.s   -ls   CWDs    s   -ps   RETR i   N(   s	   debuggings   Nones   rcfiles   syss   argvs   hosts   FTPs   ftps   set_debuglevels   userids   passwds   accts   Netrcs   netrcs   IOErrors   stderrs   writes   get_accounts   KeyErrors   logins   files   dirs   cmds   sendcmds   resps   set_pasvs   passiveservers
   retrbinarys   stdouts   quit(   s	   debuggings   rcfiles   hosts   ftps   userids   passwds   accts   netrcs   files   cmds   resps*   /usr/lib/python1.5/site-packages/ftplib.pys   testsL   		  		 s   __main__N(   s   __doc__s   oss   syss   strings   SOCKSs   sockets   ImportErrors   MSG_OOBs   FTP_PORTs   error_replys
   error_temps
   error_perms   error_protos   errors   IOErrors   EOFErrors
   all_errorss   CRLFs   FTPs   Nones   _150_res   parse150s   parse227s   parse257s
   print_lines   ftpcps   Netrcs   tests   __name__(    s*   /usr/lib/python1.5/site-packages/ftplib.pys   ?" s6   									!	 	k.