Store setup

This commit is contained in:
Richard Bronkhorst
2023-06-09 22:20:46 +02:00
parent d4c593208a
commit eeb063f307
5 changed files with 60 additions and 6 deletions

View File

@@ -1,9 +1,18 @@
from copy import deepcopy
class Base:
symbol: str
def __init__(self, symbol, store):
self.symbol = symbol
self.store = store
self.dirty = True
def dict(self):
r = deepcopy(self.__dict__)
del r['store']
del r['dirty']
return r
def path(self):
raise NotImplementedError('path')

View File

@@ -5,3 +5,7 @@ from .base import Base
class System(Base):
def ext(self):
return 'stm'
def path(self):
sector, symbol = self.symbol.split('-')
return f'atlas/{sector}/{symbol}.{self.ext()}'