%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/protocols/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/protocols/__pycache__/ftp.cpython-312.pyc |
� Ϫ�f� � �p � d Z ddlZddlZddlZddlZddlZddlZ ddlZddlZddl mZmZ ddl mZ ddlmZmZmZmZ ddlmZmZmZmZmZ ddlmZmZ ddlmZmZm Z d Z!d Z"dZ#dZ$d Z%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7d Z8d!Z9d"Z:d#Z;d$Z<d%Z=d&Z>d'Z?d(Z@d)ZAd*ZBd+ZCd,ZDd-ZEd.ZFd/ZGd0ZHd1ZId2ZJd3ZKd4ZLd5ZMd6ZNd7ZOd8ZPd9ZQd:ZRd;ZSd<ZTd=ZUd>ZVd?ZWd@ZXdAZYdBZZi e!dC�e"dD�e#dE�e$dF�e%dG�e&dH�e'dI�e(dJ�e)dK�e*dLdMg�e+dN�e,dO�e-dP�e.dQ�e0dR�e/dS�e1dT�i e2dU�e3dV�e4dW�e5dX�e6dY�e7dZ�e8d[�e9d\�e:d]�e;d^�e<d_�e=d`�e>da�e?db�e@dc�eAdd�eBde��i eCdf�eDdg�eEdh�eFdi�eGdj�eHdk�eIdl�eJdm�eKdn�eLdo�eMdp�eNdq�eOdr�ePds�eQdt�eRdu�eSdv��eTdweVdxeWdyeUdzeXd{eYd|eZd}i�Z[ G d~� de\� Z]d�� Z^d�� Z_ ej� d�� Zad�d��Zb G d�� d�e\� Zc G d�� d�ec� Zd G d�� d�ec� Ze G d�� d�ec� Zf G d�� d�ec� Zg G d�� d�ec� Zh G d�� d�ec� Zi G d�� d�ec� Zj G d�� d�ec� Zk G d�� d�ec� Zl G d�� d�ec� Zm G d�� d�e\� Zn G d�� d�e\� Zo G d�� d�ec� Zp G d�� d�ec� Zqd�� Zrg d��Zs eej� � G d�� d�ej� � � Zv G d�� d�ej� � Zx G d�� d�� Zy eej� � G d�� d�� � Zz G d�� d�ej� � Z| G d�� d�ej� ej� � Z~ G d�� d�ej� � Z� G d�� d�e� Z� G d�� d�e� Z� G d�� d�e� Z�d�� Z�d�d��Z� ee�� G d�� d�� � Z� ee�� G d�� d�� � Z� G d�� d�e�� Z� ee�� G d�� d�� � Z� ee�j � G d dë � Z� G dĄ d�e�� Z� G dƄ d�e�� Z� G dȄ d�en� Z� G dʄ d�en� Z� G d̄ d�en� Z� G d΄ d�en� Z� G dЄ d�en� Z� G d҄ dӫ Z� G dԄ d�ej� � Z� G dք d�ej� � Z� ee�� G d d�ej� � � Z�dڄ Z�dۄ Z�d܄ Z� G d݄ d�e�j4 � Z� G d߄ d�ej� � Z� G d� d�ej� � Z� G d� d�e�� Z� G d� d�ej� � Z�d� Z�y# e $ r dxZZY ���w xY w)�z An FTP protocol implementation � N)� Interface�implementer)� copyright)�checkers�credentials�error�portal)�deferr � interfaces�protocol�reactor)�basic�policies)�failure�filepath�log�100�120�125�150z200.1z200.2z200.3�202z211.1z211.2�212�213�214�215z220.1z220.2z221.1z221.2�225z226.1z226.2�227�229z230.1z230.2�250z257.1z257.2z331.1z331.2�332�350z421.1z421.2�425�426�450�451�452�500�501z502.1z502.2�503�504z530.1z530.2�532z550.1z550.2z550.3z550.4z550.5z550.6z550.7�551�552�553z110 MARK yyyy-mmmmz120 service ready in %s minutesz3125 Data connection already open, starting transferz4150 File status okay; about to open data connection.z200 Command OKz200 Type set to %s.z200 PORT OKz5202 Command not implemented, superfluous at this sitez211 System status replyz 211-Features:z211 Endz212 %sz213 %sz214 help: %sz215 UNIX Type: L8z220 %sz220 Service readyz&221 Service closing control connectionz221 Goodbye.z1225 data connection open, no transfer in progressz226 Abort successfulz226 Transfer Complete.z227 Entering Passive Mode (%s).z,229 Entering Extended Passive Mode (|||%s|).z230 User logged in, proceedz2230 Anonymous login ok, access restrictions apply.z&250 Requested File Action Completed OKz257 "%s"z257 "%s" createdz331 Password required for %s.z8331 Guest login ok, type your email address as password.z332 Need account for login.z6350 Requested file action pending further information.z6421 Service not available, closing control connection.z9421 Too many users right now, try again in a few minutes.z425 Can't open data connection.z.426 Transfer aborted. Data connection closed.z/450 Requested action aborted. File unavailable.z8451 Requested action aborted. Local error in processing.z3452 Requested action aborted. Insufficient storage.z500 Syntax error: %sz#501 syntax error in argument(s) %s.z 502 Command '%s' not implementedz 502 Option '%s' not implemented.z&503 Incorrect sequence of commands: %sz'504 Not implemented for parameter '%s'.z$530 Please login with USER and PASS.z!530 Sorry, Authentication failed.z%532 Need an account for storing filesz"550 %s: No such file or directory.z550 %s: Permission denied.z:550 Anonymous users are forbidden to change the filesystemz%550 Cannot rmd, %s is not a directoryz550 %s: File existsz550 %s: is a directoryz"550 Requested action not taken: %sz551 Page type unknownzC552 Requested file action aborted, exceeded file storage allocationz5553 Requested action not taken, file name not allowedc � � e Zd ZdZy)�InvalidPathzL Internal exception used to signify an error during parsing a path. N)�__name__� __module__�__qualname__�__doc__� � �7/usr/lib/python3/dist-packages/twisted/protocols/ftp.pyr0 r0 � s � �r6 r0 c � � |j d� rg }n| dd }|j d� D ]V }|dk( s|dk( r�|dk( r|r|j � �&t | |� �d|v sd|v rt | |� �|j |� �X |S )zn Normalize a path, as represented by a list of strings each representing one segment of the path. �/N�.� �..� )� startswith�split�popr0 �append)�cwd�path�segs�ss r7 � toSegmentsrF � s� � � ���s�����1�v�� �Z�Z��_� ����8�q�B�w�� �$�Y����� �!�#�t�,�,� �Q�Y�#��(��c�4�(�(��K�K��N�� �Kr6 c �: � | t j k( rt j t |� � S | t j k( s| t j k( rt j t |� � S | t j k( rt j t |� � S | t j k( rt j t |� � S | t j k( rt j t |� � S t j � S )z? Map C{OSError} and C{IOError} to standard FTP errors. )�errno�ENOENTr �fail�FileNotFoundError�EACCES�EPERM�PermissionDeniedError�ENOTDIR�IsNotADirectoryError�EEXIST�FileExistsError�EISDIR�IsADirectoryError)�erC s r7 �errnoToFailurerV � s� � � �E�L�L���z�z�+�D�1�2�2� �e�l�l� �a�5�;�;�.��z�z�/��5�6�6� �e�m�m� ��z�z�.�t�4�5�5� �e�l�l� ��z�z�/�$�/�0�0� �e�l�l� ��z�z�+�D�1�2�2��z�z�|�r6 �TESTc �x � | sy| d }t j |� }t j d|d� }||k( ryy)a� Helper for checking if a FTPShell `segments` contains a wildcard Unix expression. Only filename globbing is supported. This means that wildcards can only be presents in the last element of `segments`. @type segments: C{list} @param segments: List of path elements as used by the FTP server protocol. @rtype: Boolean @return: True if `segments` contains a globbing expression. F���rW � T)�fnmatch� translate�_testTranslation�replace)�segments� globCandidate�globTranslations�nonGlobTranslationss r7 �_isGlobbingExpressionrc � sJ � � �� �R�L�M��(�(��7��*�2�2�6�=�!�L���.�.��r6 c � � e Zd ZdZd� Zd� Zy)�FTPCmdErrorz- Generic exception for FTP commands. c �>