two package network fucntion uncompleted"

This commit is contained in:
2019-12-15 12:30:06 +08:00
parent dfd5369114
commit 5578131df7
4 changed files with 29 additions and 20 deletions

View File

@@ -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):