distro/repo_config: remove unnecessary name attribute from RepoConfig
This commit is contained in:
parent
e7fbcb6fbe
commit
e400361dc1
1 changed files with 0 additions and 10 deletions
|
@ -15,7 +15,6 @@ from utils import sha256sum
|
||||||
|
|
||||||
|
|
||||||
REPOS_KEY = 'repos'
|
REPOS_KEY = 'repos'
|
||||||
NAME_KEY = 'name'
|
|
||||||
REMOTEURL_KEY = 'remote_url'
|
REMOTEURL_KEY = 'remote_url'
|
||||||
LOCALONLY_KEY = 'local_only'
|
LOCALONLY_KEY = 'local_only'
|
||||||
OPTIONS_KEY = 'options'
|
OPTIONS_KEY = 'options'
|
||||||
|
@ -35,7 +34,6 @@ class BaseDistroRepo(AbstrRepoConfig):
|
||||||
|
|
||||||
|
|
||||||
class RepoConfig(AbstrRepoConfig):
|
class RepoConfig(AbstrRepoConfig):
|
||||||
name: str
|
|
||||||
remote_url: Optional[str | dict[Arch, str]]
|
remote_url: Optional[str | dict[Arch, str]]
|
||||||
local_only: Optional[bool]
|
local_only: Optional[bool]
|
||||||
|
|
||||||
|
@ -70,14 +68,6 @@ class ReposConfigFile(DataClass):
|
||||||
repos[name] = repo_cls(_repo, **kwargs)
|
repos[name] = repo_cls(_repo, **kwargs)
|
||||||
# self.repos = repos
|
# self.repos = repos
|
||||||
|
|
||||||
def toDict(self, strip_hidden: Optional[bool] = None, sparse: Optional[bool] = None):
|
|
||||||
d = super().toDict(strip_hidden=strip_hidden, sparse=sparse)
|
|
||||||
if REPOS_KEY in d:
|
|
||||||
for v in d[REPOS_KEY].values():
|
|
||||||
if isinstance(v, dict) and NAME_KEY in v:
|
|
||||||
v.pop(NAME_KEY)
|
|
||||||
return d
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_config(path: str) -> ReposConfigFile:
|
def parse_config(path: str) -> ReposConfigFile:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue