fix #123
This commit is contained in:
parent
09d436a83c
commit
3d9624f321
@ -72,15 +72,16 @@ class ConfData(object):
|
|||||||
self._work_path = work_path
|
self._work_path = work_path
|
||||||
self.conf_file = conf_file
|
self.conf_file = conf_file
|
||||||
self.auto_setting = auto_setting
|
self.auto_setting = auto_setting
|
||||||
|
self.is_init = True
|
||||||
|
|
||||||
if not os.path.exists(self.conf_file):
|
if not os.path.exists(self.conf_file):
|
||||||
self.set_conf(self.auto_setting, "last", "")
|
self.set_conf(self.auto_setting, "last", "")
|
||||||
self.is_init = True
|
|
||||||
self.read_conf()
|
self.read_conf()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def read_conf(self):
|
def read_conf(self):
|
||||||
if not self.is_init:
|
if not os.path.exists(self.conf_file):
|
||||||
self.init()
|
return False
|
||||||
try:
|
try:
|
||||||
with open(self.conf_file, 'r') as f:
|
with open(self.conf_file, 'r') as f:
|
||||||
conf = json.load(f)
|
conf = json.load(f)
|
||||||
|
Loading…
Reference in New Issue
Block a user