
    iu                        U d Z g dZddlZddlZddlmZmZmZ ddl	m
Z
 ddlmZ  G d d	ej                        Z G d
 dej                        Z G d dej                        Zeed<   eeef   ed<   eed<   eed<   e
ed<   eeeeeeeeeef   z  f   f   f   ed<   eeeeej(                  f   f   ed<   eeeeej(                  f   f   ed<   eeeeej(                  f   f   ed<   eeeeej(                  f   f   ed<    e
       dddddddd e       ddZdddddddd d!Zd"ed#ej(                  fd$Zd#ee   fd%Zd#ee   fd&Zy)'z:This module holds the *data* created by::

make data.all

)ahmia_blacklist_loadergsa_useragents_loaderdata_dir	get_cache    N   )logr   r   )CurrenciesDB)TrackerPatternsDBc                   <    e Zd ZU dZee   ed<   eed<   ee   ed<   y)UserAgentTypez%Data structure of ``useragents.json``osuaversionsN)__name__
__module____qualname____doc__liststr__annotations__     $/root/searxng/searx/data/__init__.pyr   r      s    /S	MG3ir   r   c                   0    e Zd ZU dZeed<   eed<   eed<   y)WikiDataUnitTypez4Data structure of an item in ``wikidata_units.json``si_namesymbolto_si_factorN)r   r   r   r   r   r   floatr   r   r   r   r      s    >LKr   r   c                   6    e Zd ZU dZeeef   ed<   ee   ed<   y)LocalesTypez-Data structure of an item in ``locales.json``LOCALE_NAMESRTL_LOCALESN)r   r   r   r   dictr   r   r   r   r   r   r!   r!   #   s    7sCx. cr   r!   USER_AGENTSWIKIDATA_UNITSTRACKER_PATTERNSLOCALES
CURRENCIESEXTERNAL_URLSEXTERNAL_BANGSOSM_KEYS_TAGSENGINE_DESCRIPTIONSENGINE_TRAITS)r)   r%   r*   r&   r+   r,   r-   r.   r(   r'   GSA_USER_AGENTSzuseragents.jsonzexternal_urls.jsonzwikidata_units.jsonzexternal_bangs.jsonzosm_keys_tags.jsonzengine_descriptions.jsonzengine_traits.jsonzlocales.json)r%   r*   r&   r+   r,   r-   r.   r(   namereturnc                 <   | t         vrt        dt        d|       t         |    }||S t        j                  d|        t        t        t        |    z  d      5 }t        j                  |      t         | <   d d d        t         |    S # 1 sw Y   t         |    S xY w)Nzmodule z has no attribute init searx.data.%sutf-8encoding)
lazy_globalsAttributeErrorr   r   debugopenr   data_json_filesjsonload)r0   datafs      r   __getattr__r@   Q   s    <wxl2DTHMNNDII"D)	h..	A *Q!YYq\T* * s   B

Bc                      t        t        dz  d      5 } | j                         j                         cddd       S # 1 sw Y   yxY w)zLoad data from `ahmia_blacklist.txt` and return a list of MD5 values of onion
    names.  The MD5 values are fetched by::

      searxng_extra/update/update_ahmia_blacklist.py

    This function is used by :py:mod:`searx.plugins.ahmia_filter`.

    zahmia_blacklist.txtr4   r5   N)r:   r   readsplit)r?   s    r   r   r   b   s;     
h..	A  Qvvx~~     s	   =Ac                     t         d   } | | S t        j                  dd       t        t        dz  d      5 }|j                         j                         t         d<   ddd       t         d   S # 1 sw Y   t         d   S xY w)zLoad data from `gsa_useragents.txt` and return a list of user agents
    suitable for Google.  The user agents are fetched by::

      searxng_extra/update/update_gsa_useragents.py

    This function is used by :py:mod:`searx.engines.google`.

    r/   Nr3   zgsa_useragents.txtr4   r5   )r7   r   r9   r:   r   rB   
splitlines)r>   r?   s     r   r   r   o   s     )*DII"$56	h--	@ @A*+&&(*=*=*?&'@ )**@ )**s   &A//B )r   __all__r<   typingtcorer   r   r   
currenciesr	   tracker_patternsr
   	TypedDictr   r   r!   r   r$   r   Anyr7   r;   r@   r   r   r   r   r   r   <module>rN      s   W   * * $ /AKK q{{ !++   S**+ +# #	  Cc4S4S>-A(A#BBCCD DS$sAEEz**+ +Cc155j))* *#tCJ//0 0Cc155j))* * .)+ %)++)5)	c aee "
 S	 
 +tCy +r   