%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/runner/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/runner/__pycache__/inetdconf.cpython-312.pyc

�

Ϫ�f����dZddlmZGd�de�ZGd�de�ZGd�de�ZGd	�d
e�ZGd�d�ZGd
�d�Z	Gd�de�Z
Gd�de�Zy)z
Parser for inetd.conf files
�)�Optionalc��eZdZdZy)�InvalidConfErrorz$
    Invalid configuration file
    N��__name__�
__module__�__qualname__�__doc__���:/usr/lib/python3/dist-packages/twisted/runner/inetdconf.pyrr
���rrc��eZdZdZy)�InvalidInetdConfErrorz!
    Invalid inetd.conf file
    Nrrrr
rrrrrc��eZdZdZy)�InvalidServicesConfErrorz
    Invalid services file
    Nrrrr
rrrrrc��eZdZdZy)�UnknownServicez
    Unknown service name
    Nrrrr
rrrrrc�>�eZdZUdZdZdZeeed<dd�Z	d�Z
d�Zy)	�SimpleConfFilez�
    Simple configuration file parser superclass.

    Filters out comments and empty lines (which includes lines that only
    contain comments).

    To use this class, override parseLine or parseFields.
    �#N�defaultFilenamec�h�d}|�#|jrt|j�}d}	|j�D]K}|j|j�}|dk7r|d|}|j�}|s�;|j
|��M	|r|j�yy#|r|j�wwxYw)z�
        Parse a configuration file

        If file is None and self.defaultFilename is set, it will open
        defaultFilename and use it.
        FNT���)r�open�	readlines�find�commentChar�strip�	parseLine�close)�self�filer!�line�comments     r
�	parseFilezSimpleConfFile.parseFile2s������<�D�0�0���,�,�-�D��E�	����(�

%���)�)�D�$4�$4�5���b�=����>�D��z�z�|�������t�$�

%���
�
����u��
�
���s�AB�B1c��	|j|j��y#t$rtdt	|�z��wxYw)z�
        Override this.

        By default, this will split the line on whitespace and call
        self.parseFields (catching any errors).
        zInvalid line: N)�parseFields�split�
ValueErrorr�repr)r"r$s  r
r zSimpleConfFile.parseLineQsD��	G��D���d�j�j�l�+���	G�'�(8�4��:�(E�F�F�	G�s	� �!Ac��y)z 
        Override this.
        Nr)r"�fieldss  r
r(zSimpleConfFile.parseFields]s�r�N)rrr	r
rrr�str�__annotations__r&r r(rrr
rr%s,����K�%)�O�X�c�]�)��>
G�rrc�:�eZdZdZdZdZdZdZdZdZ	dZ
dZdZd�Z
y)�InetdServicez3
    A simple description of an inetd service.
    Nc
��||_||_||_||_||_||_||_||_|	|_yr.)	�name�port�
socketType�protocol�wait�user�group�program�programArgs)
r"r4r5r6r7r8r9r:r;r<s
          r
�__init__zInetdService.__init__rsD����	���	�$��� ��
���	���	���
����&��r)rrr	r
r4r5r6r7r8r9r:r;r<r=rrr
r2r2cs;����D��D��J��H��D��D��E��G��K�'rr2c�"�eZdZdZdZdd�Zd�Zy)�	InetdConfz>
    Configuration parser for a traditional UNIX inetd(8)
    z/etc/inetd.confNc�X�g|_|�t�}|j�||_yr.)�services�ServicesConfr&�
knownServices)r"rCs  r
r=zInetdConf.__init__�s*����
�� �(�N�M��#�#�%�*��rc
�b�|jd�dgzdd\}}|jjj||fd�}	|	s|j	d�s	t|�}	d}|jjt||	|||||||�	�y#t$rtd|�d|�d���wxYw)	zx
        Parse an inetd.conf file.

        Implemented from the description in the Debian inetd.conf man page.
        �.N�zrpc/�unknownzUnknown service: z (�))
r)rCrA�get�
startswith�int�
BaseExceptionr�appendr2)
r"�serviceNamer6r7r8r9r;r<r:r5s
          r
r(zInetdConf.parseFields�s����z�z�#��$��/��!�4���e��!�!�*�*�.�.��X�/F��M���H�/�/��7�
U��;�'��'��	
�
�
�������������

�	
��!�
U�$�'8��
�R��z�QR�%S�T�T�
U�s�
B�B.r.�rrr	r
rr=r(rrr
r?r?�s���(�O�+�"
rr?c� �eZdZdZdZd�Zd�Zy)rBzj
    /etc/services parser

    @ivar services: dict mapping service names to (port, protocol) tuples.
    z
/etc/servicesc��i|_yr.)rA)r"s r
r=zServicesConf.__init__�s	����
rc���	|jd�\}}t|�}||j
||f<|D]}||j
||f<�y#t$rtdt	|�����wxYw)N�/zInvalid port/protocol: )r)rKrLrr+rA)r"r4�portAndProtocol�aliasesr5r7�aliass       r
r(zServicesConf.parseFields�s���	�,�2�2�3�7�N�D�(��t�9�D�+/��
�
�t�X�&�'��	4�E�/3�D�M�M�5�(�+�,�	4��
�	�*�)�$��*?�)@�A��
�	�s�A�!A,NrOrrr
rBrB�s���&�O��4rrBN)r
�typingr�	Exceptionrrrrrr2r?rBrrr
�<module>rYso��
���y���,���/���Y��;�;�|'�'�:1
��1
�h4�>�4r

Zerion Mini Shell 1.0