Store setup
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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()}'
|
||||
|
||||
Reference in New Issue
Block a user