
    i	                     l    U d 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e	e
d<   	 dZe	e
d<   	 d Zd Zy)a  Engine to search in collaborative software platforms based on GitLab_ with
the `GitLab REST API`_.

.. _GitLab: https://about.gitlab.com/install/
.. _GitLab REST API: https://docs.gitlab.com/ee/api/

Configuration
=============

The engine has the following mandatory setting:

- :py:obj:`base_url`

Optional settings are:

- :py:obj:`api_path`

.. code:: yaml

  - name: gitlab
    engine: gitlab
    base_url: https://gitlab.com
    shortcut: gl
    about:
      website: https://gitlab.com/
      wikidata_id: Q16639197

  - name: gnome
    engine: gitlab
    base_url: https://gitlab.gnome.org
    shortcut: gn
    about:
      website: https://gitlab.gnome.org
      wikidata_id: Q44316

Implementations
===============

    )	urlencode)parserNzhttps://docs.gitlab.com/ee/api/TFJSON)websitewikidata_idofficial_api_documentationuse_official_apirequire_api_keyresultsitrepos base_urlzapi/v4/projectsapi_pathc                 R    | |d   d}t          dt         dt        |       |d<   |S )Npageno)searchpage/?url)r   r   r   )queryparamsargss      %/root/searxng/searx/engines/gitlab.pyrequestr   C   s5    VH%56Dj(1Yt_,=>F5MM    c                 (   g }| j                         D ]  }|j                  d|j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  di       j                  d      t        j                  |j                  d      xs |j                  d            |j                  d	g       |j                  d
      |j                  d      |j                  d      d        |S )Nzpackages.htmlweb_urlnamedescription
avatar_url	namespacelast_activity_at
created_attag_list
star_count
readme_urlhttp_url_to_repo)templater   titlecontent	thumbnailpackage_name
maintainerpublishedDatetags
popularityhomepagesource_code_url)jsonappendgetr   parse)respr   items      r   responser;   J   s    G		 
+xx	*&)88M2!XXl3 $ 0"hh{B7;;FC!'dhh7I.J.ddhhWcNd!eR0"hh|4 HH\2#'88,>#?	

$ Nr   )__doc__urllib.parser   dateutilr   about
categoriespagingr   str__annotations__r   r   r;    r   r   <module>rE      sd   &P #  "C	 G_
	#  "!# !r   