distro/repo: add repo.resolve_url(self) instance method

This commit is contained in:
InsanePrawn 2022-08-08 16:35:47 +02:00
parent 6bff3c3c83
commit 0d05d3ca26

View file

@ -34,8 +34,11 @@ class Repo(RepoInfo):
remote: bool remote: bool
scanned: bool = False scanned: bool = False
def resolve_url(self) -> str:
return resolve_url(self.url_template, repo_name=self.name, arch=self.arch)
def scan(self): def scan(self):
self.resolved_url = resolve_url(self.url_template, repo_name=self.name, arch=self.arch) self.resolved_url = self.resolve_url()
self.remote = not self.resolved_url.startswith('file://') self.remote = not self.resolved_url.startswith('file://')
uri = f'{self.resolved_url}/{self.name}.db' uri = f'{self.resolved_url}/{self.name}.db'
path = '' path = ''