swh.lister.gitea.lister module

class swh.lister.gitea.lister.GiteaLister(url=None, instance=None, override_config=None, order='asc', limit=3)[source]

Bases: swh.lister.core.page_by_page_lister.PageByPageHttpLister

DEFAULT_URL = 'https://try.gitea.io/api/v1/'

alias of swh.lister.gitea.models.GiteaModel

LISTER_NAME = 'gitea'
PATH_TEMPLATE = 'repos/search?page=%d&sort=id'
get_model_from_repo(repo: Dict[str, Any]) → Dict[str, Any][source]
get_next_target_from_response(response: requests.models.Response) → Optional[int][source]

Determine the next page identifier.

get_page_from_url(url: str) → int[source]
transport_response_simplified(response: requests.models.Response) → List[Dict[str, Any]][source]
Convert the server response into list of a dict for each repo in the

response, mapping columns in the lister’s MODEL class to repo data.

Implementation of this method depends on the server API spec and the shape of the network response object returned by the transport_request method.


response – response object from the server.


list of repo MODEL dicts

( eg. [{‘uid’: r[‘id’], etc.} for r in response.json()] )

get_pages_information() → Tuple[Optional[int], Optional[int], Optional[int]][source]

Determine pages information.

run(min_bound=1, max_bound=None, check_existence=False)[source]
Main entry function. Sequentially fetches repository data from the

service according to the basic outline in the class docstring. Continually fetching sublists until either there is no next page reference given or the given next page is greater than the desired max_page.

  • min_bound – optional page to start from

  • max_bound – optional page to stop at

  • check_existence (bool) – optional existence check (for incremental lister whose sort order is inverted)