mrmp/subsystem.py

33 lines
762 B
Python
Raw Normal View History

2021-10-10 13:22:02 +00:00
import os
2021-10-10 19:30:40 +00:00
import catalog
2021-10-10 14:42:35 +00:00
CRT = 'mingw'
2021-10-10 13:22:02 +00:00
MAIN = 'msys'
2021-10-10 13:44:03 +00:00
FAMILIES = [MAIN, 'clang', 'mingw', 'ucrt']
2021-10-10 13:22:02 +00:00
class SubSystem:
2021-10-10 13:46:37 +00:00
def __init__(self, architecture, name):
2021-10-10 13:22:02 +00:00
self.architecture = architecture
self.name = name
2021-10-10 14:42:35 +00:00
# path
list = []
if self.name != MAIN:
list.append(CRT)
list.append(self.name)
if self.name == MAIN:
list.append(self.architecture.name)
2021-10-10 19:44:54 +00:00
self.path = os.path.join(*list)
2021-10-10 19:30:40 +00:00
# catalog
self.catalog = catalog.Catalog(self)
2021-10-10 13:22:02 +00:00
def __str__(self):
lines = [
f'Architecture: {self.architecture.name}',
f' Name: {self.name}',
2021-10-10 14:42:35 +00:00
f' Path: {self.path}',
2021-10-10 13:22:02 +00:00
]
return os.linesep.join(lines)