
    i                         d Z ddlZddlmZ ddlmZ dddddd	d
ZddgZdZdZ	dZ
	  ej                  d      Z	 d Zd Zy)a  SearXNG engine for `Void Linux binary packages`_.  Void is a general purpose
operating system, based on the monolithic Linux kernel. Its package system
allows you to quickly install, update and remove software; software is provided
in binary packages or can be built directly from sources with the help of the
XBPS source packages collection.

.. _Void Linux binary packages: https://voidlinux.org/packages/

    N)
quote_plus)humanize_byteszhttps://voidlinux.org/packages/	Q19310966TFJSON)websitewikidata_iduse_official_apiofficial_api_documentationrequire_api_keyresultspackagesitzhttps://xq-api.voidlinux.orgz+https://github.com/void-linux/void-packagesx86_64zRaarch64-musl|armv6l-musl|armv7l-musl|x86_64-musl|aarch64|armv6l|armv7l|i686|x86_64c                     t         j                  |       }|r2|j                  d      }| j                  |d      j	                         } nt
        }t         d| dt        |        |d<   |S )Nr    z
/v1/query/z?q=url)ARCH_REsearchgroupreplacestrip	void_archbase_urlr   )queryparams	arch_paths      (/root/searxng/searx/engines/voidlinux.pyrequestr   &   sd    u%IOOA&	i,224	j
9+SE9J8KLF5MM    c                 4   i }| j                         d   D ]~  }t        j                  dd|d         }t         d| }|j	                  |g       }|j                  |d   |d    dt        |d          |d   d	|d
    d|d    |d   d       |||<    g }|j                         D ]g  \  }}|j                  |ddj                  d |D              |d   d   dj                  d |D              |d   d
   |D cg c]  }|d   	 c}d       i |S c c}w )z
    At Void Linux, several packages sometimes share the same source code
    (template) and therefore also have the same URL.  Results with identical
    URLs are merged as one result for SearXNG.
    dataz-(32bit|dbg)$r   namez/tree/master/srcpkgs/
short_descz - filename_sizevversion_revision
repository)titlecontentpackage_namer&   tagszpackages.htmlz | c              3   &   K   | ]	  }|d      yw)r*   N .0xs     r   	<genexpr>zresponse.<locals>.<genexpr>S   s     #A1AgJ#A   r   r+   c              3   &   K   | ]	  }|d      yw)r,   Nr/   r0   s     r   r3   zresponse.<locals>.<genexpr>U   s     *O1^+<*Or4   r-   )r   templater*   r+   r,   r&   r-   )	jsonresubpkg_repo_urlgetappendr   itemsjoin)respr   resultgithub_slugpkg_urlpkg_listr   r2   s           r   responserD   2   s^    H))+f% % ff-r6&>B!N"7}E<<,$\233~f_F]7^6_` &vvi016*3E2FG|,	
 %!%$ G%^^- 
+#A#AA#A;y1 %

*Oh*O O#A;y1,45q65
	

 N 6s   <D)__doc__r8   urllib.parser   searx.utilsr   about
categoriesr   r:   r   compiler   r   rD   r/   r   r   <module>rK      sl    
 # & 1"&	 $
)<	 Q
"**i
j G	(r   