This commit is contained in:
Marc Beninca 2024-03-15 10:32:19 +01:00
parent 3eccd76e8c
commit 2eb71e6412
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
14 changed files with 0 additions and 0 deletions

23
mrmp/distribution.py Normal file
View file

@ -0,0 +1,23 @@
import os
ARCHIVE = '.tar.xz'
DISTRIBUTION = 'distrib'
class Distribution:
def __init__(self, architecture):
self.architecture = architecture
self.path = os.path.join(DISTRIBUTION, self.architecture.name)
self.load()
def load(self):
files = self.architecture.repository.get_files(self.path)
self.archives = [f for f in files if f.endswith(ARCHIVE)]
self.archive = self.archives[-1]
def __str__(self):
lines = [
f'Architecture: {self.architecture.name}',
f' Path: {self.path}',
]
return os.linesep.join(lines)