vFc@s5dZddkZddkZddkZddkZddkZddkZddkZddkZddk Z ddk Z ddk Z ddk Z ddddddd d d d d ddg Z dZdZdZdZdZhdd<dd<dd<dd<dd<dd <d!d"<d#d$<d%d&<d'd(<d)d*<d+d,<d-d.<d/d0<d1d2<d3d4<d5d6<d7d8<d9d:<d;d<<d=d><d?d@<dAdB<dCdD<dEdF<dGdH<dIdJ<dKdL<dMdN<dOdP<dQdR<dSdT>> from pyftpdlib import ftpserver >>> authorizer = ftpserver.DummyAuthorizer() >>> authorizer.add_user('user', '12345', '/home/user', perm=('r', 'w')) >>> authorizer.add_anonymous('/home/nobody') >>> ftp_handler = ftpserver.FTPHandler >>> ftp_handler.authorizer = authorizer >>> address = ("127.0.0.1", 21) >>> ftpd = ftpserver.FTPServer(address, ftp_handler) >>> ftpd.serve_forever() Serving FTP on 127.0.0.1:21 []127.0.0.1:2503 connected. 127.0.0.1:2503 ==> 220 Ready. 127.0.0.1:2503 <== USER anonymous 127.0.0.1:2503 ==> 331 Username ok, send password. 127.0.0.1:2503 <== PASS ****** 127.0.0.1:2503 ==> 230 User anonymous logged in. [anonymous]@127.0.0.1:2503 User anonymous logged in. 127.0.0.1:2503 <== TYPE A 127.0.0.1:2503 ==> 200 Type set to: ASCII. 127.0.0.1:2503 <== PASV 127.0.0.1:2503 ==> 227 Entering passive mode (127,0,0,1,9,201). 127.0.0.1:2503 <== LIST 127.0.0.1:2503 ==> 150 File status okay. About to open data connection. [anonymous]@127.0.0.1:2503 OK LIST "/". Transfer starting. 127.0.0.1:2503 ==> 226 Transfer complete. [anonymous]@127.0.0.1:2503 Transfer complete. 706 bytes transmitted. 127.0.0.1:2503 <== QUIT 127.0.0.1:2503 ==> 221 Goodbye. [anonymous]@127.0.0.1:2503 Disconnected. iNt proto_cmdstErrortlogtloglinetdebugtDummyAuthorizert FTPHandlert FTPServert PassiveDTPt ActiveDTPt DTPHandlert FileProducert AbstractedFSs%Python FTP server library (pyftpdlib)s0.2.0s ????-??-??s&Giampaolo Rodola' s#http://code.google.com/p/pyftpdlib/sSyntax: ABOR (abort transfer).tABORs5Syntax: ALLO bytes (obsolete; allocate storage).tALLOs>Syntax: APPE file-name (append data to an existent file).tAPPEs&Syntax: CDUP (go to parent directory).tCDUPs=Syntax: CWD dir-name (change current working directory).tCWDs*Syntax: DELE file-name (delete file).tDELEs$Syntax: HELP [ cmd] (show help).tHELPs+Syntax: LIST [ path-name] (list files).tLISTs9Syntax: MDTM file-name (get last modification time).tMDTMs:Syntax: MODE mode (obsolete; set data transfer mode).tMODEs-Syntax: MDK dir-name (create directory).tMKDs=Syntax: NLST [ path-name] (list files in a compact form).tNLSTsSyntax: NOOP (just do nothing).tNOOPs0Syntax: PASS user-name (set user password).tPASSs*Syntax: PASV (set server in passive mode).tPASVs@Syntax: PORT h1,h2,h3,h4,p1,p2 (set server in active mode).tPORTs,Syntax: PWD (get current working directory).tPWDs$Syntax: QUIT (quit current session).tQUITs,Syntax: REIN (reinitialize / flush account).tREINs1Syntax: REST marker (restart file position).tRESTs.Syntax: RETR file-name (retrieve a file).tRETRs-Syntax: RMD dir-name (remove directory).tRMDs:Syntax: RNFR file-name (file renaming (source name)).tRNFRs?Syntax: RNTO file-name (file renaming (destination name)).tRNTOs,Syntax: HELP file-name (get file size).tSIZEs@Syntax: STAT [ path name] (status information [list files]).tSTATs+Syntax: STOR file-name (store a file).tSTORs@Syntax: STOU [ file-name] (store a file with a unique name).tSTOUs6Syntax: STRU type (obsolete; set file structure).tSTRUs)Syntax: SYST (get operating system type).tSYSTs.Syntax: TYPE [A | I] (set transfer type).tTYPEs+Syntax: USER user-name (set username).tUSERs0Syntax: XCUP (obsolete; go to parent directory).tXCUPs@Syntax: XCWD dir-name (obsolete; change current directory).tXCWDs8Syntax: XMDK dir-name (obsolete; create directory).tXMKDs)Syntax: XPWD (obsolete; get current dir).tXPWDs8Syntax: XRMD dir-name (obsolete; remove directory).tXRMDs8Syntax: ACCT account-info (specify account information).tACCTs=Syntax: SITE [ site-cmd] (site specific server services).tSITEs:Syntax: SMNT path-name (mount file-system structure).tSMNTt format_exccCs&ti}tid||iS(Ntfile(tStringIOt tracebackt print_exctgetvalue(tf((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt _format_excs cCs/ttdoti|iSn|iSdS(sA wrap around os.strerror() which may be not available on all platforms (e.g. pythonCE). err argument expected must be an EnvironmentError class instance. tstrerrorN(thasattrtosR=terrno(terr((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt _strerrorscBseZdZRS(s!Base class for module exceptions.(t__name__t __module__t__doc__(((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRstAuthorizerErrorcBseZdZRS(s%Base class for authorizer exceptions.(RCRDRE(((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRFscCs |GHdS(s'Log messages intended for the end user.N((tmsg((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRscCs |GHdS(s?Log commands and responses passing through the command channel.N((RG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRscCs+tiit|dtiidS(s3"Log traceback outputs occurring in case of errors.s N(tsyststderrtwritetstrtflush(RG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytlogerrorscCsdS(s1"Log function/method calls (disabled by default).N((RG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRscBseZdZhZdZddddZddddZdZdZ dZ d Z d Z d Z dd Zdd ZRS(sBasic "dummy" authorizer class, suitable for subclassing to create your own custom authorizers. An "authorizer" is a class handling authentications and permissions of the FTP server. It is used inside FTPHandler class for verifying user's password, getting users home directory and checking user permissions when a file read/write event occurs. DummyAuthorizer is the base authorizer, providing a platform independent interface for managing "virtual" FTP users. System-dependent authorizers can by written by subclassing this base class and overriding appropriate methods as necessary. cCsdS(N((tself((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt__init__strtc Cs)|i|otd|ntii|ptd|nx]|D]U}|djotd|n|djo!|djotidtqRqRW|p d }n|p d }nht|d <t|d <|d <t|d<t|d<}||i |!scSs|S(((R((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR#sN(t data_wrappertTrueR(RNttype((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytenable_receivings  cCs|i|iS(s'Return the number of transmitted bytes.(RR(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytget_transmitted_bytes&scCs|idjS(s5Return True if a transfer is in progress, else False.i(R(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyttransfer_in_progress*scCsy|i|i}Wn tij o|inHX|it|7_|pt|_dSn|i i |i |dS(s-Called when there is data waiting to be read.N( trecvtac_in_buffer_sizeRwRRRtlenRRRRJR(RNtchunk((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt handle_read0s cCs|idS(s8Called when data is ready to be written, initiates send.N(t initiate_send(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRAscCs||i}t||joBxOtdt||D]!}|ii||||!q5Wn|ii||idS(s-Pushes data onto the deque and initiate send.iN(tac_out_buffer_sizeRtxrangeRtappendR(RNtdatatsabsti((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytpushEs #cCs|ii||idS(s-Push data using a producer and initiate send.N(RRR(RNtproducer((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytpush_with_producerOscCs|iS(s5Predicate for inclusion in the readable for select().(R(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytreadableTscCs|ip|i S(s5Predicate for inclusion in the writable for select().(Rt connected(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR[scCs|iiddS(sBAutomatically close this channel once the outgoing queue is empty.N(RRRo(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytclose_when_done_sc Cs3x,|io!|io|id}|p6|id=|djot|_|idSqanyt|Wn,tj o |ii|i qnXy"|i |}|i |7_ Wn&t i j o}|idSnX|o6|t|jo|||idtj o}t|}ntt i d}nX|ii d||i dS(s=Called when an exception is raised and not otherwise handled.sDTPHandler.handle_error()iisUnknown connection errors Unknown errors426 %s; transfer aborted.N( RtRRwRR@t errorcodetEnvironmentErrorRBRMR8R5R|R(RNRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs  cCs|iid|i}|io t|_n|io(|iid|iid|n%|iid|iid||idS(s!Called when the socket is closed.sDTPHandler.handle_close()s226 Transfer complete.s(Transfer complete; %d bytes transmitted.s(426 Connection closed; transfer aborted.s'Transfer aborted; %d bytes transmitted.N( RtRRRRRR|RR(RNt tot_bytes((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs    cCs|iid|io"|iip|iiq<nx<|io1|ii}t|to|iq?q?Wt i i||ii dS(sUClose the data channel, first attempting to close any remaining file handles.sDTPHandler.close()N( RtRRtclosedRRtpopt isinstanceR RrRst on_dtp_close(RNR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs   (RCRDRERRRORRRRRRRRRRRRRRRR(((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR s(           $   cBs/eZdZdZdZdZdZRS(s)Producer wrapper for file[-like] objects.icCs?d|_||_|djod|_n d|_dS(s?Intialize the producer with a data_wrapper appropriate to TYPE.iRcSs|itidS(s (R}R?R(R((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRscSs|S(((R((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRsN(tdoneR6R(RNR6R((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyROs    cCsV|iodSnA|i|ii|i}|pd|_|in|SdS(s5Attempt a chunk of data of size self.out_buffer_size.RQiN(RRR6treadtout_buffer_sizeR(RNR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs  cCs"|iip|iindS(sClose the file[-like] object.N(R6RR(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs (RCRDRERRORR(((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR s  cBseZdZdZdZdZdZdddddZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZRS(s=A cross-platform, abstract wrapper for filesystem operations.cCsd|_d|_d|_dS(Nt/(Rotroottcwdtrnfr(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyROs  cCstii|otii|}n%tiitii|i|}|idd}x |d djo|d}qbWtii|p d}n|S(sTranslate a "virtual" FTP path into an absolute "virtual" FTP path. Takes an absolute or relative virtual path and returns an absolute virtual path. Note: directory separators are system independent ("/"). s\Ris//i(R?RZtisabstnormpathtjoinRR}(RNRZRc((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt normalizes$ cCs`tii|itijotii|i|Sn!tii|i|i|SdS(sTranslate a 'virtual' FTP path into equivalent filesystem path. Take an absolute or relative path as input and return a full absolute file path. Note: directory separators are system dependent. N(R?RZRRtsepR(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt translatescCs t||S(s"Open a file returning its handler.(topen(RNtfilenametmode((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR.sRQtwbc CshdddY}d|j}dt_ti|||d|\}}ti||} || |S(sA wrap around tempfile.mkstemp creating a file with a unique name. Unlike mkstemp it returns an object with a file-like interface. The 'name' attribute contains the absolute file name. t FileWrappercBseZdZdZRS(cSs||_||_dS(N(R6tname(RNtfdR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRO8s cSst|i|S(N(tgetattrR6(RNtattr((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt __getattr__;s(RCRDROR(((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR7s tbi2ttext((ttempfiletTMP_MAXtmkstempR?tfdopen( RNtsuffixtprefixtdirRRRRRR6((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR2s   !cCstii|S(sReturn True if the path exists.(R?RZtexists(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRDscCstii|S(sReturn True if path is a file.(R?RZtisfile(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRHscCstii|S(s#Return True if path is a directory.(R?RZR[(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR[LscCsti|dS(sChange the current directory.N(R?tchdir(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRPscCsti|dS(sCreate the specified directory.N(R?tmkdir(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRTscCsti|dS(sRemove the specified directory.N(R?trmdir(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRXscCsti|dS(sRemove the specified file.N(R?tremove(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR\scCstii|S(s/Return the size of the specified file in bytes.(R?RZtgetsize(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR`scCstii|S(sMReturn the last modified time as a number of seconds since the epoch.(R?RZtgetmtime(RNRZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRdscCsti||dS(s2Rename the specified src file to the dst filename.N(R?trename(RNtsrctdst((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRiscCsFti|}|ddjotd|}nti||S(sReturn a list of files matching a dirname pattern non-recursively. Unlike glob.glob1 raises an exception if os.listdir() fails. iRpcSs|ddjS(iRp((R((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRss(R?tlistdirtfiltertfnmatch(RNtdirnametpatterntnames((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytglob1mscCs/diti|}|o |dSndS(s?Return a directory listing in a form suitable for NLST command.s RQ(RR?R(RNRZtlisting((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt get_nlst_dir{s cCs]tii|o%tii|\}}|g}n|}ti|}|i||S(s?Return a directory listing in a form suitable for LIST command.(R?RZRtsplitRt format_list(RNRZtbasedirRR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt get_list_dirs  cCs|i|}tii|\}}ti|p|i|i|}n|p:|i|i}|i ||}|i ||}nLti|odSn4|i|}|i ||}|i ||}|pdSn|S(swReturn a list of files matching a dirname pattern non-recursively in a form suitable for STAT command. s$Directory recursion not supported. sDirectory is empty. ( RR?RZRtglobt has_magicRRRRR(RNtrawlineRZRtbasenameRR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt get_stat_dirs c Csg}x|D]}tii||}ti|}y"tidti|i}Wn"tj otid}nXtii |ptii |o!|i d|i ||fq |i dd||fq Wdi|S(s#Return a directory listing emulating "/bin/ls -lgA" UNIX command output. is the absolute dirname, is a list of files contained in that directory. For portability reasons permissions, hard links numbers, owners and groups listed are static and unreliable but it shouldn't represent a problem for most ftp clients around. If you want reliable values on unix systems override this method and use other attributes provided by os.stat(). This is how output appears to client: -rwxrwxrwx 1 owner group 7045120 Sep 02 3:47 music.mp3 drwxrwxrwx 1 owner group 0 Aug 31 18:50 e-books -rwxrwxrwx 1 owner group 380 Sep 02 3:40 module.py s %b %d %H:%Ms*-rw-rw-rw- 1 owner group %15s %s %s s*drwxrwxrwx 1 owner group %15s %s %s t0RQ( R?RZRtstatttimetstrftimet localtimetst_mtimet ValueErrorRtislinkRtst_size(RNRRtresultRR6Rtmtime((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs&"&  N(RCRDRERORRRRoRRRR[RRRRRRRRRRRR(((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR s*                 cBseZdZeZeZeZe Z e Z de ZdZeZeZdZdZdZdZdZdZd ZdaZdbZdcZd*Zd+Zd,Zd-Z d.Z!d/Z"d0Z#d1Z$ed2d3Z%d4Z&d5Z'd6Z(d7Z)d8Z*d9Z+d:Z,d;Z-d<Z.d=Z/d>Z0d?Z1d@Z2dAdBZ3dCZ4dDZ5dEZ6dFZ7dGZ8dHZ9dIZ:dJZ;dKZ<dLZ=dMZ>dNZ?dOZ@dPZAdQZBdRZCdSZDdTZEdUZFdVZGdWZHdXZIdYZJdZZKd[ZLd\ZMd]ZNd^ZOd_ZPd`ZQRS(dskImplements the FTP server Protocol Interpreter (see RFC 959), handling commands received from the client on the control channel by calling the command's corresponding method. e.g. for received command "MKD pathname", ftp_MKD() method is called with "pathname" as the argument. All relevant session information is stored in instance variables. spyftpdlib %s ready.icCstii|d|||_|ii\|_|_g|_d|_ |i d|i |_ d|_d|_t|_d|_d|_d|_d|_t|_d|_d|_dS(Ntconnis RQR(tasynchatt async_chatROt ftpd_instanceRwt getpeernameRt remote_portt in_buffert in_buffer_lentset_terminatort abstracted_fstfsRot in_dtp_queuet out_dtp_queueRt authenticatedR`tattempted_loginst current_typetrestart_positiont quit_pendingt dtp_serverR(RNRR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyROs"             cCstddS(NsFTPHandler.__del__()(R(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR scCs_t|idjo|idt|in(|idt|i|iddS(sEReturn a 220 'Ready' response to the client over the command channel.iKs220 %ss220-%s s220 N(RtbannerR|RKR(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pythandlescCs2d}|id||i||idS(s?Called when limit for maximum number of connections is reached.s4Too many connections. Service temporary unavailable.s421 %sN(R|RR(RNRG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pythandle_max_conss cCs2d}|id||i||idS(s<Called when too many clients are connected from the same IP.s.Too many connections from the same IP address.s421 %sN(R|RR(RNRG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pythandle_max_cons_per_ip$s cCs|i S(N(R#(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR-scCss|ii||it|7_d}|i|jo4|id|id|g|_d|_ndS(s2Read incoming data and append to the input buffer.is500 Command too long.s-Command received exceeded buffer limit of %s.iN(RRRRR|R(RNRtbuflimit((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytcollect_incoming_data1s  R,RRR&RRR*RRRRRRRR R!R"R#R$R%R'R)R+R/R1R RRRRR-R0cCs*di|ii}g|_d|_|iddi}|id}|djo||d}nd}|djo|id|n%|id|idddf| o"||ijo|i d Sn*|o"||i jo|i d Sn|i p||i joI|d jo|o|id qt|d|d }||q&|tjo|id q&|i|n|i o1|tjo$t|d|d }||nJd|jo|idn,d |jo|idn|i|d S(sACalled when the incoming data stream matches the \r\n terminator.RQit iiRs<== %ss <== %s %st*iNR&s$530 Log in with USER and PASS first.tftp_R s******(RRtstripRRtuppertfindRtarg_cmdstcmd_missing_argt unarg_cmdstcmd_needs_no_argRt unauth_cmdsR|RRoRtcmd_not_understoodtftp_ABORtftp_STAT(RNtlinetcmdtspacetargtmethod((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytfound_terminatorHsD    $      cCs|idttdoMy|iidti}Wntij oqjX|ii|dSn|id|i dS(sCalled when there is out of band (OOB) data for the socket connection. This could happen in case of such commands needing "special action" (typically STAT and ABOR) in which case we append OOB data to incoming buffer. sFTPHandler.handle_expt()tMSG_OOBiNsCan't handle OOB data.( RR>RwRR?RRRRR(RNR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs  cCs+|idtti|idS(NsFTPHandler.handle_error()(RRMR8R5R(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs cCs|id|idS(NsFTPHandler.handle_close()(RR(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs cCs|id|io|ii|`n|io|ii|`n|`|`|iii|i t i i||i ddS(s3Close the current channel disconnecting the client.sFTPHandler.close()s Disconnected.N( RR$RRRRRtip_mapRRRRR(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs       cCs|id|io|iind|_|io}|i\}}}|o|i|n|p|ii|n|ii||io|ii nd|_n^|i oS|i \}}|o|i|n||i_ |ii |i d|_ ndS(s%Called every time data channel connects (either active or passive). Incoming and outgoing queues are checked for pending data. If outbound data is pending, it is pushed into the data channel. If awaiting inbound data, the data channel is enabled for receiving. sFTPHandler.on_dtp_connection()N(RR$RRoRRRRRRRRRR!(RNRt isproducerRR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs*        cCs2|idd|_|io|indS(sCalled on DTPHandler.close().sFTPHandler.on_dtp_close()N(RRoRR#R(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs   cCs&|i|d|id|dS(s8Send a response to the client using the command channel.s s==> %sN(RR(RNtresp((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR|sRQcCs|ioo|id|o|i|n|p|ii|n|ii||io|iiqn |id|||f|_dS(sCalled every time a RETR, LIST or NLST is received. Pushes data into the data channel. If data channel does not exist yet, we queue the data to send later. Data will then be pushed into data channel when on_dtp_connection() is called. "data" argument can be either a string or a producer of data to push. boolean argument isproducer; if True we assume that is a producer. log argument is a string to log this push event with. s4125 Data connection already open. Transfer starting.s4150 File status okay. About to open data connection.N(RR|RRRRR(RNRRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt push_dtp_datas    cCs|id|dS(s8Return a 'command not understood' message to the client.s 500 Command "%s" not understood.N(R|(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR6scCs|iddS(s2Return a 'missing argument' message to the client.s,501 Syntax error: command needs an argument.N(R|(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR2scCs|iddS(sCReturn a 'command does not accept arguments' message to the client.s4501 Syntax error: command does not accept arguments.N(R|(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR4scCs'td|i|i|i|fdS(s=Log a message, including additional identifying session data.s [%s]@%s:%s %sN(RR`RR(RNRG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRscCs!td|i|i|fdS(s:Log a line including additional indentifying session data.s%s:%s %sN(RRR(RNRG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR scCst|dS(sLog a debug message.N(R(RNRG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRscCs|io.|iip|iid|_q8n|io|iid|_nd|i_t|_d|_ d|_ d|_ d|_ t|_ d|_d|_dS(svFlush account information by clearing attributes that need to be reset on a REIN or new USER command. RQiRN(RRRRoR$RRRRR`R R!R"R#RR(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt flush_accounts              cCsyT|id}di|d idd}t|ddt|d}Wn*ttfj o|iddSnX|ip@||ijo,|i d||f|id dSqn|i p7|d jo&|i d ||id dSq n|i o|i i d|_ n|io|ii d|_n|iioLt|i|iijo,d }|id||i |dSqn|i|||dS(sStart an active data-channel.RqRpiiis504 Invalid PORT format.Ns2Rejected data connection to foreign address %s:%s.s'504 Can't connect to a foreign address.is.PORT against the privileged port "%s" refused.s)504 Can't connect over a privileged port.s.Too many connections. Can't open data channel.s425 %s(RRR}tintR t OverflowErrorR|RRRtpermit_privileged_portR$RRoRRtmax_consRt_mapt active_dtp(RNR9R~RRG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_PORT-s>&                   cCs|io|iid|_n|io|iid|_n|iioLt|i|iijo,d}|id||i |dSqn|i ||_dS(sStart a passive data-channel.s.Too many connections. Can't open data channel.s425 %sN( R$RRoRRRHRRIR|Rt passive_dtp(RNR9RG((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_PASVcs         cCs|ii|i}t|djo|id|n|id||id|ip|in t|_ dS(sQuit the current session.iKs221 %ss221-%s s221 N( t authorizerRkR`RR|RRRRR#(RNR9RX((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_QUITzs  cCs |oc|id jo(|ii|ii}|ii}q|ii|}|ii|}n%|ii|ii}|ii}y|ii|}WnItj o=}t|}|id||f|i d|nX|i |dd|d S( s|Return a list of files in the specified directory to the client. Defaults to the current working directory. s-as-ls-als-lasFAIL LIST "%s". %s.s550 %s.Rs OK LIST "%s". Transfer starting.N(s-as-ls-als-la( tlowerRRRRRtOSErrorRBRR|RC(RNR9RZRRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_LISTs  cCs|o(|ii|}|ii|}n%|ii|ii}|ii}y|ii|}WnItj o=}t|}|id||f|id|nX|i |dd|dS(sReturn a list of files in the specified directory in a compact form to the client. Default to the current directory. sFAIL NLST "%s". %s.s550 %s.Rs OK NLST "%s". Transfer starting.N( RRRRRRQRBRR|RC(RNR9RZRRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_NLSTs  cCs|ii|}|ii|i|p2|id|ii||iddSny|ii|d}WnYt j oM}t |}|id|ii||f|id|dSnX|i od}y>|i |ii |j pt |i|i d}Wn9t j o d }n"t j o}t |}nXd|_ |p<|id ||id|ii||fdSqnt||i}|i|d dd d |ii|dS(sMRetrieve the specified file (transfer from the server to the client) s&FAIL RETR "s". Not enough priviledges.s'550 Can't RETR: not enough priviledges.NtrbsFAIL RETR "%s". %s.s550 %s.iisInvalid REST parameters554 %sRARs OK RETR "%s". Download starting.(RRRNRmR`RRR|RtIOErrorRBR"RtAssertionErrortseekR R!RC(RNR9R6RRARtokR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_RETRs>   #  $   # RRc Cs|d|jo d}nd}|ii|}|ii|itii|p8|id||ii |f|i ddSn|i o d}ny|ii ||d}Wn\t j oP}t|}|id ||ii ||f|i d |dSnX|i od }y>|i |ii|j pt|i|i d }Wn9tj o d }n"t j o}t|}nXd |_ |p?|i d||id ||ii ||fdSqnd||ii |f} |io=|i d|i| ||i_|ii|in|i d|| f|_dS(s6Store a file (transfer from the client to the server).RRR's%FAIL %s "%s". Not enough priviledges.s'550 Can't STOR: not enough priviledges.Nsr+RsFAIL %s "%s". %s.s550 %s.iisInvalid REST parameters554 %ssOK %s "%s". Upload starting.s4125 Data connection already open. Transfer starting.s4150 File status okay. About to open data connection.(RRRNRnR`R?RZRRRR|R"RRURBRRVRWRRRR!R( RNR9RR:R6RRARRXR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_STORsR  %     &  $   &      c Cs|io|iddSn|o2tii|ii|\}}|d}n|ii|ii}d}|ii |i |p&|i dt |iddSny|ii d|d|}Wnvtj oj}|itijo d }n t|}|id ||i d |ii||fdSnXtii|i}d |}|ioA|id ||i |||i_|ii|in!|id|||f|_dS(s.Store a file on the server with a unique name.s-550 Can't STOU while REST request is pending.NRpsftpd.s&FAIL STOU "%s". Not enough priviledgess'550 Can't STOU: not enough priviledges.RRs!No usable unique file name found.s450 %s.sFAIL STOU "%s". %s.sOK STOU "%s". Upload starting.s 125 FILE: %ss 150 FILE: %s(R"R|R?RZRRRRRNRnR`RRBRRUR@tEEXISTRBRRRRRRR!R( RNR9RRRRARRR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_STOU.s<  $   #     cCs6|io|iddSn|i|dddS(s.Append data to an existing file on the server.s-550 Can't APPE while REST request is pending.NRR(R"R|RZ(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_APPEfs  cCsy't|}|djo tnWn&ttfj o|idn-X|id||id|||_dS(s-Restart a file transfer from a previous mark.is501 Invalid parameter.s>350 Restarting at position %s. Now use RETR/STOR for resuming.s OK REST %s.N(RER RFR|RR"(RNR9tmarker((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_RESTos   cCs|idjo|idjo d}n|io |iid|_d}n|iow|iio:|iid|_|id|idd}q|iid|_|idd}n|i|dS(s Abort the current data transfer.s225 No transfer to abort.s1225 ABOR command successful; data channel closed.s(426 Connection closed; transfer aborted.s/OK ABOR. Transfer aborted, data channel closed.s226 ABOR command successful.sOK ABOR. Data channel closed.N(R$RoRRRR|R(RNR9RB((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR7~s$                cCsm|idjo d}n|ip|idn)|i|id||id||_dS(s)Set the username for the current session.RSs331 Username ok, send password.s7OK USER "%s". Previous account information was flushed.s<331 Previous account information was flushed, send password.N(RPRR|RDRR`(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_USERs   cCs;|io|iddSn|ip|iddSn|ii|io4|ii|i|p|idjo|ii|i}t|djo|id|n|id||idt |_d |_ |ii |i|i _ |id |iq7|i d 7_ |i |ijo|id |in|id d|_|id|in|i d 7_ |i |ijo/|id|i|id |in_|iidjo|id|idn+|id |id|id|_dS(s1Check username's password against the authorizer.s503 User already authenticated.Ns503 Login with USER first.RSiKs230 %ss230-%s s230 isUser %s logged in.is*530 Maximum login attempts. Disconnecting.s530 Authentication failed.RQs#Authentication failed (user: "%s").s-Authentication failed: unknown username "%s".s!530 Anonymous access not allowed.s4Authentication failed: anonymous access not allowed.(RR|R`RNRYRhRjRRRR RiRRRtmax_login_attemptsRRP(RNR9RW((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_PASSsL                 cCs(|id|i|iddS(s$Reinitialize user's current session.s&OK REIN. Flushing account information.s230 Ready for new user.N(RRDR|(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_REINs  cCs|id|iidS(s?Return the name of the current working directory to the client.s"257 "%s" is the current directory.N(R|RR(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_PWDscCs|p d}n|ii|}|ii|}ti}y|ii|WnUtj oI}t|}|id|ii||f|i d|nIX||i_ |id|ii |i d|ii ti|dS(s%Change the current working directory.RsFAIL CWD "%s". %s.s550 %s.s OK CWD "%s".s"250 "%s" is the current directory.N( RRRR?tgetcwdRRQRBRR|R(RNR9tftp_patht real_pathtold_dirRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_CWD s   # cCs|iddS(s!Change into the parent directory.s..N(Ri(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_CDUP+scCs|ii|}|ii|o|iddSny|ii|}WnUtj oI}t|}|id|ii||f|id|n0X|id||id|ii|dS(sYReturn size of file in a format suitable for using with RESTart as defined into RFC 3659. Implementation note: properly handling the SIZE command when TYPE ASCII is used would require to scan the entire file to perform the ASCII translation logic (file.read(int).replace(os.linesep, ' ')) and then calculating the len of such data which may be different than the actual size of the file on the server. Considering that the calculating such result could be very resource-intensive it could be easy for a malicious client to try a DoS attack, thus we do not perform the ASCII translation. However, clients in general should not be resuming downloads in ASCII mode. Resuming downloads in binary mode is the recommended way as specified into RFC 3659. s#550 Could not get a directory size.NsFAIL SIZE "%s". %ss550 %s.s213 %ss OK SIZE "%s".( RRR[R|RRQRBRR(RNR9RZtsizeRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_SIZE2s  #cCs|ii|}|ii|p|iddSny|ii|}WnUtj oI}t|}|id|ii||f|id|nKXt i dt i |}|id||id|ii|dS(sReturn last modification time of file to the client as an ISO 3307 style timestamp (YYYYMMDDHHMMSS) as defined into RFC 3659. s550 No such file.NsFAIL MDTM "%s". %ss550 %s.s %Y%m%d%H%M%Ss213 %ss OK MDTM "%s".( RRRR|RRQRBRRR R R (RNR9RZtlmtRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_MDTMSs  #cCs|ii|}|ii|itii|p2|id|ii ||i ddSny|ii |WnUt j oI}t |}|id|ii ||f|i d|n,X|id|ii ||i ddS(sCreate the specified directory.s&FAIL MKD "%s". Not enough priviledges.s&550 Can't MKD: not enough priviledges.NsFAIL MKD "%s". %s.s550 %s.s OK MKD "%s".s257 Directory created.(RRRNRnR`R?RZRRRR|RRQRB(RNR9RZRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_MKDhs%   #cCs:|ii|}||iijo0d}|id||id|dSn|ii|i|p2|id|ii||iddSny|ii |WnUt j oI}t |}|id|ii||f|id|n,X|id |ii||id dS( sRemove the specified directory.sCan't remove root directory.s550 %ssFAIL MKD "/". %sNs&FAIL RMD "%s". Not enough priviledges.s&550 Can't RMD: not enough priviledges.sFAIL RMD "%s". %s.s550 %s.s OK RMD "%s".s250 Directory removed.( RRRR|RRNRnR`RRRQRB(RNR9RZRGRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_RMD}s$  #cCs|ii|}|ii|i|p2|id|ii||iddSny|ii|WnUt j oI}t |}|id|ii||f|id|n,X|id|ii||iddS(sDelete the specified file.s'FAIL DELE "%s". Not enough priviledges.s'550 Can't DELE: not enough priviledges.NsFAIL DELE "%s". %s.s550 %s.s OK DELE "%s".s250 File removed.( RRRNRnR`RRR|RRQRB(RNR9RZRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_DELEs   #cCs|ii|}|ii|i|p8|id||ii|f|iddSn|ii|o||i_ |idn|iddS(sWRename the specified (only the source name is specified here. See RNTO command)s4FAIL RNFR "%s". Not enough priviledges for renaming.s'550 Can't RNRF: not enough priviledges.Ns350 Ready for destination name.s550 No such file or directory.( RRRNRnR`RRR|RR(RNR9RZ((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_RNFRs   c Cs|iip|iddSn|ii|ii}|ii|}|ii|i|iipV|id|ii|ii|ii|f|idd|i_dSnzy|ii ||Wnjt j o^}t |}|id|ii|ii|ii||f|id|nDX|id|ii|ii|ii|f|idWdd|i_XdS( sCRename file (destination name only, source is specified with RNFR).s-503 Bad sequence of commands: use RNFR first.Ns@FAIL RNFR/RNTO "%s ==> %s". Not enough priviledges for renaming.s'550 Can't RNTO: not enough priviledges.sFAIL RNFR/RNTO "%s ==> %s". %s.s550 %s.sOK RNFR/RNTO "%s ==> %s".s250 Renaming ok.( RRR|RRNRnR`RRRoRRQRB(RNR9RRRAR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_RNTOs.   ,    / ,cCso|i}|d jo|idd|_n9|djo|id d |_n|id |d S(s*Set current type data type to binary/asciitAtANsA Ns200 Type set to: ASCII.RtItL8sL 8s200 Type set to: Binary.Rs504 Unsupported type "%s".N(RtRusA N(RvRwsL 8(R/R|R!(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_TYPEs       cCs/|djo|idn|iddS(sSet file structure (obsolete).R;tFs&200 File transfer structure set to: F.s504 Unimplemented STRU type.N(R;Ry(R|(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_STRUs cCs/|djo|idn|iddS(s!Set data transfer mode (obsolete)tstSs200 Transfer mode set to: Ss504 Unimplemented MODE type.N(R{R|(R|(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_MODEs cCs|p/g}|idttf|id|ii|io|id|in)|ip|idn|id|idjo d}nd}|id ||io?|id |id |ii |id |ii n|id |i di ||i dnvy|ii|}Wn%tj o}t|d}nX|i d|ii||i ||i ddS(sReturn statistics about current ftp session. If an argument is provided return directory listing over command channel. s211-%s %s status: sConnected to: %s:%s sLogged in as: %s sWaiting for username. sWaiting for password. RtASCIItBinarys)TYPE: %s; STRUcture: File; MODE: Stream sData connection open: sTotal bytes sent: %ssTotal bytes received: %ssData connection closed. s s211 End of status.s. s213-Status of "%s": s213 End of status.N(Rt __pname__t__ver__RwRuRR`R!RRRRRR|RRRQRBR(RNR9R{RRRA((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyR8s6        cCs|iddS(s Do nothing.s250 I succesfully done nothin'.N(R|(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_NOOP6scCs|iddS(s1Return system type (always returns UNIX type L8).s215 UNIX Type: L8N(R|(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_SYST;scCs|iddS(s&Allocate bytes for storage (obsolete).s$202 No storage allocation necessary.N(R|(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_ALLOEscCs|oC|itjo|idt|iq}|idn4d}|id|i||iddS(sReturn help text to the client.s214 %s.s500 Unrecognized command.cSstg}ti}|ixH|o@t|dd!}|idt||d|dd5qWdi|S(Niis %-6ss RQ(RtkeystsortttupleRRR(tcmdsRtelems((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytformatted_helpUs   s,214-The following commands are recognized: s214 Help command succesful.N(R/RR|R(RNR9R((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_HELPKs cCs|i|dS(s=Change to the parent directory. Synonym for CDUP. Deprecated.N(Rj(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_XCUPkscCs|i|dS(sBChange the current working directory. Synonym for CWD. Deprecated.N(Ri(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_XCWDoscCs|i|dS(s<Create the specified directory. Synonym for MKD. Deprecated.N(Ro(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_XMKDsscCs|i|dS(sBReturn the current working directory. Synonym for PWD. Deprecated.N(Rd(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_XPWDwscCs|i|dS(s<Remove the specified directory. Synonym for RMD. Deprecated.N(Rp(RNR9((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pytftp_XRMD{s(R,sPASSRsSTATRRR*(RsAPPERRRRRR R!R"R#R$R%sSTORR)R+R,R/R1( sABORRRRRRRR*R-R0(RRCRDRERRNR RJRRLR RR RRR%RaRRRGRORR&R'R(RR*R5R1R3R>RRRRRRR|RCR6R2R4RRRRDRKRMRORRRSRYRZR\R]R_R7R`RbRcRdRiRjRlRnRoRpRqRrRsRxRzR}R8RRRRRRRRR(((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs        ;     !         6     , = 8  %  8    !      " 7      cBs_eZdZdZdZdZdZdZdZdZ dZ d e dZ RS( sThis class is an asyncore.disptacher subclass. It creates a FTP socket listening on
, dispatching the requests to a (typically FTPHandler class). icCstii|||_||_g|_|ititi t i djo|i n|i |i|iddS(Ntposixi(RrRsROtaddressRR@RvRwRxRyR?Rtset_reuse_addrRzR{(RNRR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyROs   cCstddS(NsFTPServer.__del__()(R(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRscOstd|iiy<|p|oti||ntidddtWn3tttifj otd|i nXdS(s@A wrap around asyncore.loop(); starts the asyncore polling loop.sServing FTP on %s:%sttimeoutituse_pollsShutting down FTPd.N( RRwRuRrtloopRtKeyboardInterruptt SystemExittExitNowt close_all(RNtargstkwargs((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyt serve_forevers cCstd|i\}}td||i||}|d}|ii||io/t|i|ijo|i dSqn|i o2|ii ||i jo|i dSqn|i dS(s1Called when remote client initiates a connection.sFTPServer.handle_accept()s[]%s:%s Connected.iN(RRRRR@RRHRRIR'tmax_cons_per_iptcountR(R&(RNRRRR~((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs        cCsdS(Ni((RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRscCs(tdtti|idS(s)Called to handle any uncaught exceptions.sFTPServer.handle_error()N(RRMR8R5R(RN((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs cCs|djo*t|dp ti}q7|i}nx|iD]}y|iWqDtj o/}|dti joq|pqqDti t t fj o qD|pqqDXqDW|i dS(sl'clean' shutdown: instead of using the current asyncore.close_all() function which only close sockets, we iterate over all existent channels calling close() method for each one of them, avoiding memory leaks. This is how close_all function will appear in the fixed version of asyncore that will be included into Python 2.6. RIiN(RoR>Rrt socket_mapRItvaluesRRQR@tEBADFRRRtclear(RNtmapt ignore_allR((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs&     N(RCRDRERHRRORRRRRRoRR(((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyRs     cCsHt}|iti|t_d}t|t}|idS(NRQi(RQi(RRfR?ReRRNRR(RNRtftpd((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pyttests   t__main__(4RERrRRwR?RHR8R@R RRRR\t__all__RRt__date__t __author__t__web__Rtdeprecated_cmdstupdatetnot_implemented_cmdsR>t cStringIOR7t ImportErrorR<R5RBt ExceptionRRFRRRMRRRsRR t collectionsRRR R R RRRRRC(((sYE:\Programmazione\Python\Sources\[PRJ] - pyftpdlib\pyftpdlib_0.2.0\pyftpdlib\ftpserver.pysis                                                             gT6#u