
    -.fJ                     T    d dl Zd dlZd dlZd dlZd dlZ G d d      Z G d d      Zy)    Nc                       e Zd Zdg di fdZy)QuirkN c                     || _         || _        || _        i j                  t        j
                  j                  d      | _        y )Nr   )idhandler	x_snippetfromkeysQuirks	quirkinfodmi_keys
match_tags)selfr   r   r	   r   s        4/usr/lib/python3/dist-packages/Quirks/quirkreader.py__init__zQuirk.__init__   s5    "++f&6&6&?&?D    )__name__
__module____qualname__r    r   r   r   r      s    bR Er   r   c                       e Zd ZddZd Zy)	ReadQuirkNc                    || _         | j                   }|d k(  rg }n\t        |d      s@t        |dd      }	 |j                         }|j	                          |j	                          n|j                         }d}d}d}d}g | _        d}	|D ]  }
|
j                         j                  d      r$|r3|rS|
j                         j                         j                  d      rd}Y| j                  |	   xj                  |
z  c_
        ||s|
j                         j                         j                  d	      rgd
}d	}|
|
j                         j                  |      t        |      z   d  j                         j                  dd      }|| j                  |	   _        ~|s|
j                         j                         j                  d      rxd
}d}|
|
j                         j                  |      t        |      z   d  j                         j                  dd      }|j                  d      }|| j                  |	   _        ~|
j                         j                         j                  d      rd}|
|
j                         j                  |      t        |      z   d  j                         j                  d      }d}d}g }|D ]d  }|j                         s|s|j                         }'|j                         }|j                  d      }|| j                  |	   j"                  |<    n ~~~|
j                         j                         j                  d      rd
}d| j                  |	   _
        |
j                         j                         j                  d      sd}| j                  |	   j                  s| j                  j%                  |	       S|	dz  }	Z|
j                         j                         j                  d      sd|
j                         v sd
}t'               }| j                  j)                  |       ~ y # t
        $ r g }Y w xY w)Nwriterzutf-8)encodingFr   #endxorgsnippet
identifierT"r   r   |matchxorgsnippet
endsection   sectionquirk)sourcehasattropen	readlinescloseUnicodeDecodeError_quirksstrip
startswithlowerr	   rfindlenreplacer   splitr   r   popr   append)r   r(   file
lines_listmyfileinside_quirkhas_idhas_handlerinside_x_snippetitlinetemp_strr   r   handlers_list	temp_bits	tag_match	tag_value
tag_valueselem
temp_quirks                        r   r   zReadQuirk.__init__&   s    {{4<J4)dC':$!'!1!1!3JLLN  "^^-
  D	Dzz|&&s+#zz|))+667GH+0( R(22d:2 "djjl&8&8&:&E&El&S!%#/!$**,"4"4X">%B' #' #( )).b1A .0R(+$(TZZ\-?-?-A-L-LY-W&*#,"&tzz|'9'9('Cc%G' (' (( #)).b1A  (/c(:3@R(0$++-88A#*$(););H)E$'M*2 *3 %449EGEE#J "$&	$&	%'
$- 	*D#zz|'004

I 15

I1:1EJMWDLL$4$?$?	$J$)	* &$&++-88G+/(57R(2 ++-88F',#||B/22 LL,,R0!GB::<%%'229=tzz|+#'L!&JLL''
3"ID	 * $!#J$s    Q Q#"Q#c                     | j                   S N)r.   )r   s    r   
get_quirkszReadQuirk.get_quirks   s    ||r   rJ   )r   r   r   r   rK   r   r   r   r   r   $   s    `Dr   r   )	xkit.xutilsxkitxkit.xorgparserQuirks.quirkinfor   tempfileosr   r   r   r   r   <module>rR      s.   *     	E Ee er   