Update api.py, commander.py and one other file

This commit is contained in:
Richard Bronkhorst
2023-06-17 23:07:53 +02:00
parent 9987481848
commit c2a1f787a2
3 changed files with 19 additions and 4 deletions

View File

@@ -25,10 +25,14 @@ class Survey(SystemMember):
def is_expired(self):
return time() > self.expires or self.exhausted
def waypoint(self):
p = self.symbol.split('-')
return '-'.join(p[:3])
def api_dict(self):
return {
'signature': self.symbol,
'symbol': str(self.waypoint),
'symbol': self.waypoint(),
'deposits': [{'symbol': d} for d in self.deposits],
'expiration': self.expires_str,
'size': size_names[self.size]