Spaces:
Sleeping
Sleeping
Added zero_state property
Browse files
utils.py
CHANGED
@@ -1,8 +1,10 @@
|
|
|
|
1 |
import json
|
2 |
|
3 |
|
4 |
|
5 |
class Test:
|
|
|
6 |
names = ["БМ", "ДС", "ІС", "АД", "ЕС", "ОШ", "АК", "АШ", "ФС", "МВ", "НГ", "НП"]
|
7 |
|
8 |
def __init__(self):
|
@@ -14,6 +16,11 @@ class Test:
|
|
14 |
def __len__(self):
|
15 |
return len(self.data)
|
16 |
|
|
|
|
|
|
|
|
|
|
|
17 |
@staticmethod
|
18 |
def read_test_data():
|
19 |
with open("test.json") as f:
|
|
|
1 |
+
from copy import deepcopy
|
2 |
import json
|
3 |
|
4 |
|
5 |
|
6 |
class Test:
|
7 |
+
_zero_state = {"value":-1, "responses":[]}
|
8 |
names = ["БМ", "ДС", "ІС", "АД", "ЕС", "ОШ", "АК", "АШ", "ФС", "МВ", "НГ", "НП"]
|
9 |
|
10 |
def __init__(self):
|
|
|
16 |
def __len__(self):
|
17 |
return len(self.data)
|
18 |
|
19 |
+
@property
|
20 |
+
def zero_state(self):
|
21 |
+
state = deepcopy(self._zero_state)
|
22 |
+
return state
|
23 |
+
|
24 |
@staticmethod
|
25 |
def read_test_data():
|
26 |
with open("test.json") as f:
|