a lot: profiles, some more help strings. partial: exceptions instead of exit()

Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
This commit is contained in:
InsanePrawn 2021-09-29 02:00:59 +02:00
parent e705af21f5
commit f09deaa9a5
9 changed files with 190 additions and 106 deletions

View file

@ -38,7 +38,7 @@ class Repo:
remote: bool
def scan(self):
self.resolved_url = resolve_url(self.url_template, self.repo_name, self.arch)
self.resolved_url = resolve_url(self.url_template, repo_name=self.repo_name, arch=self.arch)
self.remote = not self.resolved_url.startswith('file://')
# TODO
@ -50,6 +50,10 @@ class Repo:
if scan:
self.scan()
def config_snippet(self) -> str:
options = {'Server': self.url_template} | self.options.items()
return ('[%s]\n' % self.name) + '\n'.join([f"{key} = {value}" for key, value in options])
class RepoInfo:
options: dict[str, str] = {}
@ -85,6 +89,9 @@ class Distro:
for package in repo.packages:
results[package.name] = package
def config_snippet(self) -> str:
return '\n'.join(repo.config_snippet() for repo in self.repos)
_base_distros: dict[str, Distro] = None