0ptr/nullptr/models/agent.py

22 lines
369 B
Python
Raw Normal View History

2023-06-10 17:39:32 +00:00
from .base import Base
class Agent(Base):
token: str = None
credits: int = 0
def update(self, d):
2023-06-10 18:49:50 +00:00
self.seta('credits', d)
2023-06-10 17:39:32 +00:00
def path(self):
return f'{self.symbol}.{self.ext()}'
@classmethod
def ext(self):
return 'agt'
def f(self, detail=1):
r = super().f(detail)
if detail >2:
r += f' c:{self.credits}'
return r