mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-13 17:09:15 +00:00
Catch some ui settings errors
This commit is contained in:
parent
d8e7ba7ab0
commit
7f78e26e38
|
@ -479,6 +479,7 @@ def read_ui_settings():
|
|||
ui_mynode_file = '/home/bitcoin/.mynode/ui.json'
|
||||
|
||||
# read ui.json from HDD
|
||||
try:
|
||||
if os.path.isfile(ui_hdd_file):
|
||||
with open(ui_hdd_file, 'r') as fp:
|
||||
ui_settings = json.load(fp)
|
||||
|
@ -486,6 +487,9 @@ def read_ui_settings():
|
|||
elif os.path.isfile(ui_mynode_file):
|
||||
with open(ui_mynode_file, 'r') as fp:
|
||||
ui_settings = json.load(fp)
|
||||
except Exception as e:
|
||||
# Error reading ui settings
|
||||
pass
|
||||
|
||||
# If no files were read, init variable and mark we need to write files
|
||||
need_file_write = False
|
||||
|
@ -513,11 +517,11 @@ def write_ui_settings(ui_settings_new):
|
|||
try:
|
||||
with open(ui_hdd_file, 'w') as fp:
|
||||
json.dump(ui_settings, fp)
|
||||
except:
|
||||
pass
|
||||
|
||||
with open(ui_mynode_file, 'w') as fp:
|
||||
json.dump(ui_settings, fp)
|
||||
except:
|
||||
pass
|
||||
|
||||
def get_ui_setting(name):
|
||||
ui_settings = read_ui_settings()
|
||||
|
|
Loading…
Reference in New Issue
Block a user