iterate repository architectures

This commit is contained in:
Marc Beninca 2021-10-27 22:12:40 +02:00 committed by Marc Beninca
parent 884a4e1583
commit 4d1237b6fd
3 changed files with 6 additions and 3 deletions

View file

@ -17,7 +17,7 @@ def check():
packages = []
broken = []
lo = local.Local()
for architecture in lo.architectures:
for architecture in lo:
for subsystem in architecture.subsystems.values():
for package in subsystem.catalog.packages.values():
packages.append((subsystem, package))

View file

@ -10,9 +10,12 @@ class Repository:
self.architectures = [architecture.Architecture(self, a)
for a in arguments.architectures]
def __iter__(self):
return self.architectures.__iter__()
def __str__(self):
lines = [
f' Location: {self.location}',
f'Architectures: {[a.name for a in self.architectures]}',
f'Architectures: {[architecture.name for architecture in self]}',
]
return os.linesep.join(lines)

View file

@ -15,7 +15,7 @@ class Synchronization:
self.threads = arguments.threads
def run(self):
for architecture in self.remote.architectures:
for architecture in self.remote:
for subsystem in architecture.subsystems.values():
for _, package in sorted(subsystem.catalog.packages.items()):
f = file.File(