Skip to content
Snippets Groups Projects
Commit cc686268 authored by Franck Bret's avatar Franck Bret
Browse files

url and instance are now mandatory

parent 5b4d1509
No related branches found
No related tags found
1 merge request!488D lang lister
......@@ -22,7 +22,7 @@ Origins retrieving strategy
---------------------------
To build a list of origins we make a GET request to an `http api endpoint`_ that returns
a Json array of objects.
a JSON-formatted array of objects.
The origin url for each package is constructed with the information of corresponding
`repository` entry which represents Git based projects hosted on Github, GitLab or
Bitbucket.
......
......@@ -27,18 +27,19 @@ class DlangLister(StatelessLister[DlangListerPage]):
INSTANCE = "dlang"
BASE_URL = "https://code.dlang.org"
PACKAGES_DUMP_URL = BASE_URL + "/api/packages/dump"
PACKAGES_DUMP_URL_PATTERN = "{url}/api/packages/dump"
KINDS = {
"github": "https://github.com",
"gitlab": "https://gitlab.com",
"bitbucket": "https://bitbucket.com",
}
KIND_URL_PATTERN = "{url}/{owner}/{project}"
def __init__(
self,
scheduler: SchedulerInterface,
url: str = BASE_URL,
instance: str = INSTANCE,
credentials: Optional[CredentialsType] = None,
max_origins_per_page: Optional[int] = None,
max_pages: Optional[int] = None,
......@@ -47,8 +48,8 @@ class DlangLister(StatelessLister[DlangListerPage]):
super().__init__(
scheduler=scheduler,
credentials=credentials,
instance=self.INSTANCE,
url=self.PACKAGES_DUMP_URL,
instance=instance,
url=self.PACKAGES_DUMP_URL_PATTERN.format(url=url),
max_origins_per_page=max_origins_per_page,
max_pages=max_pages,
enable_origins=enable_origins,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment