Skip to content

Commit 3e6e0fc

Browse files
committed
Strikes are no longer; GameStatus uses Time
1 parent b8965c9 commit 3e6e0fc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

servercom/implementations/circuitpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def get_status(self) -> GameStatus:
387387
resp_json = loads(resp[1])
388388
if self.v:
389389
print(f"It is {resp_json['unix_time']} seconds since the epoch.")
390-
return GameStatus(resp_json['unix_time'], resp_json['status']['score'], resp_json['status']['strikes'])
390+
return GameStatus(Time(resp_json['unix_time']), resp_json['status']['score'])
391391

392392
def post(self, point: DataPoint) -> bool:
393393
if self.v:

servercom/implementations/common.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414

1515

1616
GameStatus = namedtuple("GameStatus",
17-
['unix_time',
18-
'score',
19-
'strikes']
17+
['time',
18+
'score']
2019
)
2120

2221
HTTPResponse = namedtuple("HTTPResponse",

servercom/implementations/cpy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""CPython implementation of the CubeServer API Wrapper Library"""
22

33
from .common import *
4+
from ..timetools import Time
45

56
import ssl
67
import socket
@@ -340,7 +341,7 @@ def request(
340341
def get_status(self) -> GameStatus:
341342
resp = self.request('GET', '/status')
342343
resp_json = loads(resp[1])
343-
return GameStatus(resp_json['unix_time'], resp_json['status']['score'], resp_json['status']['strikes'])
344+
return GameStatus(Time(resp_json['unix_time']), resp_json['status']['score'])
344345

345346
def post(self, point: DataPoint) -> bool:
346347
return self.request(

0 commit comments

Comments
 (0)