Displace default preferences in get_preferences method
parent
58894fa9d3
commit
170de8be0e
|
@ -47,11 +47,6 @@ class ManjaroHello():
|
||||||
|
|
||||||
# Load preferences
|
# Load preferences
|
||||||
self.preferences = self.get_preferences()
|
self.preferences = self.get_preferences()
|
||||||
if not self.preferences:
|
|
||||||
self.preferences = {
|
|
||||||
"autostart": os.path.isfile(self.autostart_path),
|
|
||||||
"locale": None
|
|
||||||
}
|
|
||||||
|
|
||||||
# Load system infos
|
# Load system infos
|
||||||
self.infos = get_infos()
|
self.infos = get_infos()
|
||||||
|
@ -186,7 +181,10 @@ class ManjaroHello():
|
||||||
with open(self.preferences_path, "r") as f:
|
with open(self.preferences_path, "r") as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
return None
|
return {
|
||||||
|
"autostart": os.path.isfile(self.autostart_path),
|
||||||
|
"locale": None
|
||||||
|
}
|
||||||
|
|
||||||
def read_page(self, name):
|
def read_page(self, name):
|
||||||
filename = self.data_path + "pages/{}/{}".format(self.preferences["locale"], name)
|
filename = self.data_path + "pages/{}/{}".format(self.preferences["locale"], name)
|
||||||
|
|
Loading…
Reference in New Issue