o
    U7e                     @   s0   d dl Z d dlZd dlmZ G dd deZdS )    N)ElementTreec                   @   s   e Zd Zdd Zdd ZdS )CountryInformationc           
      C   s   i | _ d}tj|rCt|d}|d}|D ]+}d|jv r$|jd }n|jd }d|jv r4|jd }n|jd }td|| j |< qd | _	d | _
tjd	d
d}|d}|d}	|	dkrbt|}	||d |	 | _
| | j
| _	d S )Nz%/usr/share/xml/iso-codes/iso_3166.xml)fileiso_3166_entrycommon_namenamealpha_2_codealpha_3_codeiso_3166LANGzen.UK)default_.   )	countriesospathexistsr   iterattribgettextdgettextcountrycodegetenvfindlenget_country_name)
selffnameetitelmdescrr   localeaz r(   G/usr/lib/python3/dist-packages/softwareproperties/CountryInformation.py__init__   s,   







zCountryInformation.__init__c                 C   s   || j v r| j | }|S |S )N)r   )r   r   r   r(   r(   r)   r   7   s   

z#CountryInformation.get_country_nameN)__name__
__module____qualname__r*   r   r(   r(   r(   r)   r      s    r   )r   r   xml.etree.ElementTreer   objectr   r(   r(   r(   r)   <module>   s   