ó
    z#¶g·  ã                   ó2   • S SK r SSKJr  SS jrSS jrS rg)	é    Né   )Ú
exceptionsc                 ód  • U c  g [         R                  " U[         R                  [         R                  -  5      n/ nUc  [        [        [        U 5      5      5      nU H.  nUR                  X   5      (       d  M  UR                  U5        M0     U$ ! [         a    [
        R                  ef = f)a%  
Use the pattern_str to find any match in a list of strings

This is a helper function for :func:`egrep_hierarchy`.

Note that this function is never called with the `subindex`
parameter set.

Parameters
----------
strlist : [str, ...]
    list of strings in which to look for the pattern
pattern_str : str
    regular expression pattern
subindex : [int, ...]
    list of indexes of strings in strlist, specifying the elements
    in which to look for the pattern

Returns
-------
[int, ...]
    a list of indexes for the matches in the origin list
N)ÚreÚcompileÚIÚMÚ	Exceptionr   ÚInvalidRegexÚlistÚrangeÚlenÚsearchÚappend)ÚstrlistÚpattern_strÚsubindexÚpatÚ
resultlistÚis         Ú5/usr/lib/python3/dist-packages/reportbug/hiermatch.pyÚ
egrep_listr   
   s›   € ð0 �Øð&Ü�jŠj˜¤b§d¡d¬R¯T©T¡kÓ2ˆð €JØÑÜœœc '›lÓ+Ó,ˆÛˆØ�:‰:�g‘j×!Ó!Ø×Ñ˜aÖ ñ ð Ðøô ó &Ü×%Ñ%Ð%ð&ús   †6B ÂB/c                 óÔ   • / n[        [        U 5      5       HM  nU(       a!  X%   (       a  [        X   U   XU   5      nO/ nO[        X   U   U5      nUR                  U5        MO     U$ )aˆ  
Grep the nth item of a hierarchy [(x, [a, b]),...]

This is a helper function for :func:`matched_hierarchy`.

Note that this function is never called with the `subhier` and `nth`
parameters set.

Parameters
----------
hier : [(str, [str, ...]), (str, [str, ...]), ...]
    list of tuples with severity and bug list
pattern_str : str
    regular expression pattern
subhier : [[int, ...], ...], optional
    subhierarchy indices
nth : int, optional
    should always be 1 (one)

Returns
-------
[[int, ...], [int, ...], ...]
    a subhierarchy (for each severity in the input hierarchy, the
    list of indexes of the bugs matching the pattern_str)
)r   r   r   r   )Úhierr   ÚsubhierÚnthÚ
resulthierr   r   s          r   Úegrep_hierarchyr   3   sg   € ð4 €Jä”3�t“9ÖˆÞØ�zÜ'¨©°©°kÈ1Á:ÓN‘
à‘
ä# D¡G¨C¡L°+Ó>ˆJà×Ñ˜*Ö%ñ ð Ðó    c                 óÞ   • / n[        X5      n[        [        U5      5       HB  nX4   (       d  M  X4    Vs/ s H  oPU   S   U   PM     nnUR                  X   S   U45        MD     U$ s  snf )av  
Create a new hierarchy from a pattern matching

Parameters
----------
hier : [(str, [str, ...]), (str, [str, ...]), ...]
    list of tuples with severity and bug list
pattern_str : str
    regular expression pattern

Returns
-------
[(str, [str, ...]), (str, [str, ...]), ...]
    list of tuples with severity and bug list, only including bugs
    matching the pattern_str
r   r   )r   r   r   r   )r   r   ÚmhierÚresultr   ÚyÚitems          r   Úmatched_hierarchyr%   \   sp   € ð" €EÜ˜TÓ/€FÜ”3�v“;ÖˆØ�9‰9Ø+1ª9Ó5ª9 a˜‘G˜A‘J˜q”M©9ˆDÐ5Ø�L‰L˜$™' !™* dÐ+Ö,ñ  ð €Lùò 6s   ¶A*)N)Nr   )r   Ú r   r   r   r%   © r   r   Ú<module>r(      s   ðó 
Ý ô&ôR&óRr   