0ptr/nullptr/models/marketplace.py

22 lines
532 B
Python
Raw Normal View History

from .base import Base
from typing import List
class Marketplace(Base):
imports:List[str] = []
exports:List[str] = []
exchange:List[str] = []
def update(self, d):
self.setlst('imports', d, 'imports', 'symbol')
self.setlst('exports', d, 'exports', 'symbol')
self.setlst('exchange', d, 'exchange', 'symbol')
@classmethod
def ext(self):
return 'mkt'
def path(self):
sector, system, symbol = self.symbol.split('-')
return f'atlas/{sector}/{system[0:1]}/{system}/{symbol}.{self.ext()}'