temporary

This commit is contained in:
Marc Beninca 2021-10-09 18:19:58 +02:00 committed by Marc Beninca
parent 960f6303fd
commit 47120adeb5

View file

@ -9,9 +9,6 @@ class Repository:
def __init__(self, args): def __init__(self, args):
self.directory = args[arguments.DIRECTORY] self.directory = args[arguments.DIRECTORY]
self.temporary = args[arguments.TEMPORARY] self.temporary = args[arguments.TEMPORARY]
self.tmp = os.path.join(self.temporary,
datetime.datetime.now()
.strftime('%Y%m%d%H%M%S'))
self.load() self.load()
def load(self): def load(self):
@ -29,6 +26,11 @@ class Repository:
d[architecture] = archive d[architecture] = archive
self.archives = d self.archives = d
def get_temporary():
return os.path.join(self.temporary,
datetime.datetime.now()
.strftime('%Y%m%d%H%M%S'))
def __str__(self): def __str__(self):
lines = [ lines = [
f'Directory: {self.directory}', f'Directory: {self.directory}',
@ -37,5 +39,4 @@ class Repository:
] ]
for architecture, archive in reversed(sorted(self.archives.items())): for architecture, archive in reversed(sorted(self.archives.items())):
lines.append(f'{architecture}{archive}') lines.append(f'{architecture}{archive}')
lines.append(f'Temporary: {self.tmp}')
return os.linesep.join(lines) return os.linesep.join(lines)