From 7800bb9175aa1ed801255c37df1d1bf2d8114dfa Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 19:56:24 +0200 Subject: [PATCH] architectures --- architecture.py | 22 +++++++--------------- repository.py | 2 +- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/architecture.py b/architecture.py index 7323109..9398e4d 100644 --- a/architecture.py +++ b/architecture.py @@ -4,14 +4,17 @@ import arguments import distribution import subsystem -X86 = 'x86_64' -I86 = 'i686' +ARCHITECTURES = { + 'x86_64': (64, [subsystem.MAIN, 'clang64', 'mingw64', 'ucrt64']), + 'i686' : (32, [subsystem.MAIN, 'clang32', 'mingw32']), +} class Architecture: - def __init__(self, name, bits, subsystems): + def __init__(self, repository, name): + self.repository = repository self.name = name - self.bits = bits + self.bits, subsystems = ARCHITECTURES[self.name] self.distribution = distribution.Distribution(self) self.subsystems = {s: subsystem.SubSystem(self, s) for s in [f if f == subsystem.MAIN @@ -25,14 +28,3 @@ class Architecture: f'Bits: {self.bits}', ] return os.linesep.join(lines) - - -x86 = Architecture(X86, 64, [subsystem.MAIN, - 'clang64', 'mingw64', 'ucrt64']) -i86 = Architecture(I86, 32, [subsystem.MAIN, - 'clang32', 'mingw32']) - -ARCHITECTURES = { - X86: x86, - I86: i86, -} diff --git a/repository.py b/repository.py index 93d0928..77de2b2 100644 --- a/repository.py +++ b/repository.py @@ -7,7 +7,7 @@ import arguments class Repository: def __init__(self, location): self.location = location - self.architectures = [architecture.ARCHITECTURES[a] + self.architectures = [architecture.Architecture(self, a) for a in arguments.architectures] def __str__(self):