swh.lister.gitea.lister module

class swh.lister.gitea.lister.GiteaLister(scheduler: swh.scheduler.interface.SchedulerInterface, url: str, instance: Optional[str] = None, api_token: Optional[str] = None, page_size: int = 50, credentials: Optional[Dict[str, Dict[str, List[Dict[str, str]]]]] = None)[source]

Bases: swh.lister.pattern.StatelessLister[List[Dict[str, Any]]]

List origins from Gitea.

Gitea API documentation: https://try.gitea.io/api/swagger

The API does pagination and provides navigation URLs through the ‘Link’ header. The default value for page size is the maximum value observed on the instances accessible at https://try.gitea.io/api/v1/ and https://codeberg.org/api/v1/.

LISTER_NAME: str = 'gitea'
REPO_LIST_PATH = 'repos/search'
page_request(url: str, params: Dict[str, Any]) requests.models.Response[source]
classmethod results_simplified(body: Dict[str, List[Dict[str, Any]]]) List[Dict[str, Any]][source]
get_pages() Iterator[List[Dict[str, Any]]][source]

Retrieve a list of pages of listed results. This is the main loop of the lister.

Returns

an iterator of raw pages fetched from the platform currently being listed.

get_origins_from_page(page: List[Dict[str, Any]]) Iterator[swh.scheduler.model.ListedOrigin][source]

Convert a page of Gitea repositories into a list of ListedOrigins.