+
    Dfj                         R t ^ RIHt  ! R R]4      t ! R R]4      t ! R R]4      t ! R R	]4      t ! R
 R4      t ! R R4      t	 ! R R]4      t
 ! R R]4      tR# )z
Parser for inetd.conf files
)Optionalc                       ] tR t^tRtRtR# )InvalidConfErrorz
Invalid configuration file
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       :/usr/lib/python3/dist-packages/twisted/runner/inetdconf.pyr   r          r   r   c                       ] tR t^tRtRtR# )InvalidInetdConfErrorz
Invalid inetd.conf file
r   Nr   r   r   r   r   r      r   r   r   c                       ] tR t^tRtRtR# )InvalidServicesConfErrorz
Invalid services file
r   Nr   r   r   r   r   r      r   r   r   c                       ] tR t^tRtRtR# )UnknownServicez
Unknown service name
r   Nr   r   r   r   r   r      r   r   r   c                   N   a  ] tR t^%t o RtRtRtR	R ltR tR t	V 3R lt
RtV tR# )
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.
#Nc                   RpVf*   V P                   '       d   \        V P                   4      pRp VP                  4        FU  pVP                  V P                  4      pVR8w  d   VRV pVP                  4       pV'       g   KD  V P                  V4       KW  	  V'       d   VP                  4        R# R#   T'       d   TP                  4        i i ; i)zw
Parse a configuration file

If file is None and self.defaultFilename is set, it will open
defaultFilename and use it.
FNT)defaultFilenameopen	readlinesfindcommentCharstrip	parseLineclose)selffiler"   linecomments   &&   r   	parseFileSimpleConfFile.parseFile2   s     <D000,,-DE	())D$4$45b=>D zz| t$ ) 

 u

 s   AB6 B6 6Cc                     V P                   ! VP                  4       !   R#   \         d    \        R\	        T4      ,           4      hi ; i)zu
Override this.

By default, this will split the line on whitespace and call
self.parseFields (catching any errors).
zInvalid line: N)parseFieldssplit
ValueErrorr   repr)r#   r%   s   &&r   r!   SimpleConfFile.parseLineQ   sB    	Gdjjl+ 	G'(84:(EFF	Gs	   " 'A	c                    R# )z
Override this.
Nr   )r#   fieldss   &*r   r*   SimpleConfFile.parseFields]   s    r   c                6   < V ^8  d   Qh/ S[ S[,          ;R&   # )   r   )r   str)format__classdict__s   "r   __annotate__SimpleConfFile.__annotate__%   s      c]) r   r   N)r   r   r	   r
   r   r   r   r'   r!   r*   __annotate_func__r   __classdictcell__r6   s   @r   r   r   %   s.      K%)O>
Gq  r   r   c                   N   a  ] tR t^ct o RtRtRtRtRtRt	Rt
RtRtRtR tRtV tR# )InetdServicez+
A simple description of an inetd service.
Nc
                r    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        Wn        R # r9   )	nameport
socketTypeprotocolwaitusergroupprogramprogramArgs)
r#   r@   rA   rB   rC   rD   rE   rF   rG   rH   s
   &&&&&&&&&&r   __init__InetdService.__init__r   s2     		$ 		
&r   )	rF   r@   rA   rG   rH   rC   rB   rE   rD   )r   r   r	   r
   r   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   r   r;   r<   s   @r   r>   r>   c   sC      DDJHDDEGK' 'r   r>   c                   8   a  ] tR t^t o RtRtRR ltR tRtV t	R# )	InetdConfz6
Configuration parser for a traditional UNIX inetd(8)
z/etc/inetd.confNc                \    . V n         Vf   \        4       pVP                  4        Wn        R # r9   )servicesServicesConfr'   knownServices)r#   rP   s   &&r   rI   InetdConf.__init__   s(     (NM##%*r   c                   VP                  R4      R.,           R,          w  rXV P                  P                  P                  W3R4      p	V	'       g&   VP	                  R4      '       g    \        V4      p	RpV P                  P                  \        VV	VVVVVVV4	      4       R#   \         d    \        RT RT R24      hi ; i)	z`
Parse an inetd.conf file.

Implemented from the description in the Debian inetd.conf man page.
.N:Nr3   Nzrpc/unknownzUnknown service: z ())
r+   rP   rN   get
startswithintBaseExceptionr   appendr>   )
r#   serviceNamerB   rC   rD   rE   rG   rH   rF   rA   s
   &&&&&&&*  r   r*   InetdConf.parseFields   s     zz#$/4 !!**../FMH//77U;'' 	
	
 ! U$'8RzQR%STTUs   *B% %C)rP   rN   r9   
r   r   r	   r
   r   r   rI   r*   r   r;   r<   s   @r   rL   rL      s       (O+"
 "
r   rL   c                   4   a  ] tR t^t o RtRtR tR tRtV t	R# )rO   z^
/etc/services parser

@ivar services: dict mapping service names to (port, protocol) tuples.
z/etc/servicesc                    / V n         R # r9   rN   )r#   s   &r   rI   ServicesConf.__init__   s	    r   c                     VP                  R 4      w  rE\        V4      pY@P
                  Y3&   T F  pY@P
                  Ye3&   K  	  R#   \         d    \        R\	        T4       24      hi ; i)/zInvalid port/protocol: N)r+   rX   rY   r   r-   rN   )r#   r@   portAndProtocolaliasesrA   rC   aliass   &&&*   r   r*   ServicesConf.parseFields   sz    	,2237NDt9D +/t&'E/3MM5+,   	*)$*?)@A 	s   A	 	#A,r`   Nr]   r<   s   @r   rO   rO      s       &O4 4r   rO   N)r   typingr   	Exceptionr   r   r   r   r   r>   rL   rO   r   r   r   <module>rj      so   
 y , / Y ; ;|' ':1
 1
h4> 4r   