two package network fucntion uncompleted"
This commit is contained in:
10
config.py
10
config.py
@@ -1,4 +1,3 @@
|
||||
import json
|
||||
import threading
|
||||
import json
|
||||
import time
|
||||
@@ -15,13 +14,14 @@ class Jsondata:
|
||||
self.thread = threading.Thread(target=self.run, args=())
|
||||
self.thread.start()
|
||||
|
||||
def try_to_read_jsondata(self, key, or_value, template=0):
|
||||
def try_to_read_jsondata(self, key, or_value, template=0, output=True):
|
||||
if key in self.raw_jsondata.keys():
|
||||
return self.raw_jsondata[key]
|
||||
else:
|
||||
print('Error: could not find key value in file "config.json"\n'
|
||||
'Please set the key "%s" in file "config.json"\n'
|
||||
'Or MSW will set it as %s' % (key, or_value))
|
||||
if output:
|
||||
print('Error: could not find key value in file "config.json"\n'
|
||||
'Please set the key "%s" in file "config.json"\n'
|
||||
'Or MSW will set it as %s' % (key, or_value))
|
||||
return or_value
|
||||
|
||||
def get(self, key):
|
||||
|
||||
Reference in New Issue
Block a user