+
    
4iV$                         R t ^ RIt^ RIt^ RIHtHtHtHtHtH	t	 ^t
RRRRRRR	R
/t]P                  ! R4      t ! R R]4      t ! R R]4      tR R ltR R lt ! R R4      t ! R R4      tR# )z'Functions for working with watch files.N)IterableIteratorListOptionalSequenceTextIOz@ANY_VERSION@z[-_]?(\d[\-+\.:\~\da-zA-Z]*)z@ARCHIVE_EXT@z2(?i)\.(?:tar\.xz|tar\.bz2|tar\.gz|zip|tgz|tbz|txz)z@SIGNATURE_EXT@zL(?i)\.(?:tar\.xz|tar\.bz2|tar\.gz|zip|tgz|tbz|txz)\.(?:asc|pgp|gpg|sig|sign)z	@DEB_EXT@z%[\+~](debian|dfsg|ds|deb)(\.)?(\d+)?$zdebian.watchc                       ] tR t^7tRtRtR# )MissingVersionzThe version= line is missing. N__name__
__module____qualname____firstlineno____doc____static_attributes__r
       ./usr/lib/python3/dist-packages/debian/watch.pyr	   r	   7   s    'r   r	   c                       ] tR t^;tRtRtR# )WatchFileFormatErrorz(Raised when the input is not valid.
    r
   Nr   r
   r   r   r   r   ;   s    r   r   c                <    V ^8  d   QhR\         R\         R\         /# )   textpackagereturnstr)formats   "r   __annotate__r   @   s!       s s r   c                    \        \        P                  4       4      pWR&   VP                  4        F  w  r4V P                  W44      p K  	  V # )zApply substitutions to a string.

:param text: text to apply substitutions to
:param package: package name, as a string
:return: text with subsitutions applied
z	@PACKAGE@)dictSUBSTITUTIONSitemsreplace)r   r   substskvs   &&   r   expandr'   @   sF     -%%'(F ";||A! Kr   c                4    V ^8  d   QhR\         R\        RR/# )r   msgstrictr   N)r   bool)r   s   "r   r   r   P   s!      3   r   c                 V    V'       d   \        V 4      h\        P                  V 4       R # N)r   loggerwarning)r)   r*   s   &&r   	_complainr0   P   s    "3''
NN3r   c                   T   a  ] tR t^Vt o RtRR]3R ltR tR t]	RR l4       t
RtV tR# )		WatchFilezA Debian watch file.

:ivar entries: list of Watch entries
:ivar options: optional list of global options, applied to all Watch
    entries
:ivar version: watch file version
Nc                B    W0n         Vf   . pWn        Vf   . pW n        R # r-   )versionentriesoptions)selfr5   r6   r4   s   &&&&r   __init__WatchFile.__init___   s'    
 ?G?Gr   c                ,    \        V P                  4      # r-   )iterr5   r7   s   &r   __iter__WatchFile.__iter__l   s    DLL!!r   c                   R pV P                   e#   VP                  RV P                   ,          4       V P                  '       d)   VP                  V! V P                  4      R,           4       V P                   EF  pVP                  '       d)   VP                  V! VP                  4      R,           4       VP                  VP                  4       VP
                  '       d#   VP                  RVP
                  ,           4       VP                   '       d#   VP                  RVP                   ,           4       VP                  '       d#   VP                  RVP                  ,           4       VP                  R4       EK	  	  R# )a'  Write the contents of a watch file to a file-like object.

Note that this will not preserve the formatting of the original file,
and thus it is currently not possible to use this function to
parse and reserialize a file and end up with the same contents.

:param f: File-like object to write to
c                 r    R P                  V 4      pRV9   g   RV9   d   RV,           R,           # RV,           # ), 	zopts=""opts=)join)optsss   & r   serialize_options)WatchFile.dump.<locals>.serialize_optionsz   s5    Aax419!|c))Q;r   Nzversion=%d

rB   )r4   writer6   r5   urlmatching_patternscript)r7   frI   entrys   &&  r   dumpWatchFile.dumpp   s    	 <<#GGNT\\12<<<GG%dll3d:;\\E}}})%--83>?GGEII%%%e4445}}}emm+,|||ell*+GGDM "r   c                   . p. pV F  pVP                  R4      '       d   K  VP                  4       '       g   K4  VP                  R4      P                  R4      '       d#   VP	                  VP                  R4      4       K|  VP	                  V4       VP	                  V4       . pK  	  V'       d   \        RV4       VP	                  V4       V'       g   R# RP                  VP                  ^ 4      4      p VP                  R^4      w  rxTP                  4       R	8w  d   \        4       h\        TP                  4       4      p	. p
. pT EF  pT	^8  d   T Uu. uF  qP                  4       NK  	  ppRP                  T4      P                  4       pT'       g   KR  TP                  R
4      '       dy   T^,          R8X  d=   TP                  R^4      pTR8X  d   \        RT,          4      hT^T pY^^,           R pM TR,          P                  R^4      w  rTP                  R4      pM. pT'       d    TP                  R^4      w  pp\        P                  ! RT4      pT'       dR   \!        T^ ,          4      3\#        TP                  R^4      4      ,           pTR\%        T^ ,          4      ) ^,
           pM\#        TP                  R^4      4      pTP	                  \'        T.TO5RT/ 4       EK  T
P)                  T4       EK  	  T ! YT	R7      #   \         d    \        4       hi ; iu upi   \         d    TR,          pRp EL5i ; i  \         d	    TpRp ELi ; i)a  Parse from the contents that make up a watch file.

:param lines: watch file lines to parse
:return: instance or None if there are no non-comment lines in the file
:raise MissingVersion: if there is no version number declared
:raise ValueError: when syntax errors are encountered
#rK   \z
\z*watchfile ended with \; skipping last lineN =r4   rE   rD   zNot matching " in %r:   NNrA   z/([^/]*\([^/]*\)[^/]*)$rG   r5   r6   r4   )
startswithstriprstripendswithappendr0   rF   popsplit
ValueErrorr	   intlstripindexrefindallr   tuplelenWatchextend)clslinesr*   joined_lines	continuedline	firstlinekeyvaluer4   persistent_optionsr5   chunkedchunkoptendopts_strrG   rM   mpartss   &&&                 r   
from_linesWatchFile.from_lines   s    	Ds##::<<{{4 ))$//  V!45  &##I.	  CVL	*GGL,,Q/0		#"a0JC 99;)# ""ekkm$#G{ 8??we<<>w?777#))+Dw''7c>!ZZQ/F|()?$)FGG#Af~Hq	?D"+/8>>$+B(  ~~c* $

4 3IC JJ93? 1YME$**T12E,FFEmAaD	z!|,C!$**T1"56EuS<5<t<="))$/M $N J 	J]  	# ""	# @ & "#'8!" " CDs6   ;L L3L89ML08MMM('M(rZ   F)r   r   r   r   r   DEFAULT_VERSIONr8   r=   rR   classmethodr|   r   __classdictcell____classdict__s   @r   r2   r2   V   s=      ("@ NJ NJr   r2   c                   F   a  ] tR t^t o RtRR ltV 3R lR ltR tRtV t	R# )	rk   a3  Watch line entry.

This will contain the attributes documented in uscan(1):

:ivar url: The URL (possibly including the filename regex)
:ivar matching_pattern: a filename regex, optional
:ivar version: version policy, optional
:ivar script: script to run, optional
:ivar opts: a list of options, as strings
Nc                N    Wn         W n        W0n        W@n        Vf   . pWPn        R # r-   )rM   rN   r4   rO   r6   )r7   rM   rN   r4   rO   rG   s   &&&&&&r   r8   Watch.__init__   s(      0<Dr   c                    < V ^8  d   QhRS[ /# )r   r   r   )r   r   s   "r   r   Watch.__annotate__   s     : :# :r   c                    V P                   P                  : R V P                  : RV P                  : RV P                  : RV P
                  : RV P                  : R2# )(z, matching_pattern=z
, version=z	, script=z, opts=))	__class__r   rM   rN   r4   rO   r6   r<   s   &r   __repr__Watch.__repr__   s<     ''43H3Hdkk4<<9	:r   c                l   \        V\        4      '       g   R # VP                  V P                  8H  ;'       d}    VP                  V P                  8H  ;'       d\    VP                  V P                  8H  ;'       d;    VP
                  V P
                  8H  ;'       d    VP                  V P                  8H  # r~   )
isinstancerk   rM   rN   r4   rO   r6   )r7   others   &&r   __eq__Watch.__eq__  s    %''		TXX% . .&&$*?*??. .-. . +. . -		/r   )rN   r6   rO   rM   r4   )NNNN)
r   r   r   r   r   r8   r   r   r   r   r   s   @r   rk   rk      s#     	: :/ /r   rk   )r   loggingrg   typingr   r   r   r   r   r   r   r!   	getLoggerr.   	Exceptionr	   rc   r   r'   r0   r2   rk   r
   r   r   <module>r      s   $ .  	  
 4 J 	& 9  
		>	*(Y (: 
 IJ IJX)/ )/r   