mrmp/repository.py

22 lines
549 B
Python
Raw Normal View History

2021-10-10 13:01:24 +00:00
import os
2021-10-10 13:44:03 +00:00
import architecture
import arguments
2021-10-10 13:01:24 +00:00
2021-10-10 12:48:12 +00:00
class Repository:
2021-10-10 13:01:24 +00:00
def __init__(self, location):
self.location = location
2021-10-10 17:56:24 +00:00
self.architectures = [architecture.Architecture(self, a)
2021-10-10 13:44:03 +00:00
for a in arguments.architectures]
2021-10-10 13:01:24 +00:00
2021-10-27 20:12:40 +00:00
def __iter__(self):
return self.architectures.__iter__()
2021-10-10 13:01:24 +00:00
def __str__(self):
lines = [
2021-10-10 13:44:03 +00:00
f' Location: {self.location}',
2021-10-27 20:12:40 +00:00
f'Architectures: {[architecture.name for architecture in self]}',
2021-10-10 13:01:24 +00:00
]
return os.linesep.join(lines)