-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.py
24 lines (20 loc) · 838 Bytes
/
globals.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python3
import json
class My_globals:
spider_parmfile = "spiderparms.json"
spider_def_parms = {"SOUND_ON": False,
"VOLUME":10000, # 0 <= VOLUME <= 32768
"MAX_INT":800, # 0 <= MAX_INT <= 1000
"END_REQUEST": False } # to inhibit the eyes while we're using the IR board
def __init__(self):
self.animation_active = False
self.get_spider_parms()
self.spider_parms["END_REQUEST"] = False
def get_spider_parms(self):
try:
with open(self.spider_parmfile, "r") as f:
self.spider_parms = json.load(f)
except FileNotFoundError:
# instead, use the defaults defined above
self.spider_parms = self.spider_def_parms
print(self.spider_parmfile, ": file not found.")