
    0c                          d dl Z  G d d      Zy)    Nc                   6    e Zd Zd Zd Zd Zd Zd Zd Zd Z	y)	Rexerc                    t        |      j                  }| j                          i | _        |dk(  r=|| _        | j                  j
                  j                  | _        | j                          nM|dk(  rHi | _        | j                  D ]1  }t        j                  | j                  |         | j                  |<   3 y | j                  D ]1  }t        j                  | j                  |         | j                  |<   3 y )NErimpAbovo)type__name__set_for_constantsrseabovo	constantsset_the_othersssrecompile)selfargargtypess       !/home/ernad/ernad/python/rexer.py__init__zRexer.__init__   s    s)$$ gDF!VV\\33DN!DGWW 4ZZ
3
4 	0ADGGAJ/DGGAJ	0    c                 ^    i | _         d| j                   d<   | j                   dxx   dz  cc<   y )Nz&\s{2}<variable name="([^"]+)" select="is_constants_linez'([^"]+)'"/>)r   )r   s    r   r
   zRexer.set_for_constants   s.    'P#$#$(EE$r   c                    d}d}i }d|z   dz   |d<   d|d<   |d   dz   |d   z   |d	<   d|z   dz   |d
<   d|d<   t        j                  | j                  d         |d<   |d   t        j                  d      z   |d<   d|z   dz   |z   |d   z   dz   |d<   d|z   dz   |z   |d   z   dz   |d<   d|d<   |dxx   dz  cc<   || _        y )Nz\d{4}-\d{2}-\d{2}z[a-z0-9]{6}^$is_datez(\d{4}-\d{2}-\d{2})has_date_has_double_dateis_shotiz^[a-z]{3,4}-[a-z0-9]+$
is_repcodeext_amfamf_extz.gz
amf_ext_gzis_rif	is_rif_gzz(\s*<variable\s+name="([^"]+)"\s+select="	conf_linez'([^']+)'"/>\s*$|)r   escaper   r   )r   date_reshoti_rer   s       r   r   zRexer.set_the_others   s   ( g+91: ": 4n!x#-:3<		$..";<9i=299U+;;<W}s*X59EK8-#-8|"#;G;
;44r   c                 V    | j                   j                  | j                  d         ryy)Nr   TF)r   matchr   r   strings     r   r   zRexer.is_date/   s!    77==+,r   c                 `    d| j                   vry| j                   d   j                  |      ryy)Nr$   FTr   r/   r0   s     r   r$   zRexer.is_repcode4   s.    tww&77< &&v.r   c                     | j                   d   j                  |      ry| j                   d   j                  |      ryy)Nr)   Tr(   Fr3   r0   s     r   r(   zRexer.is_rif;   s9    77;%%f-778""6*r   c                 H    | j                   d   j                  |      }|d   S )Nr    r   )r   search)r   r1   matchess      r   get_issuedatezRexer.get_issuedateB   s%    ''*%,,V4qzr   N)
r	   
__module____qualname__r   r
   r   r   r$   r(   r8    r   r   r   r      s&    0"F
(
r   r   )r   r   r;   r   r   <module>r<      s    	A Ar   