Improve config file search (#440)
This commit is contained in:
parent
e1e3437d62
commit
6b043d63bc
@ -242,7 +242,12 @@ class KlipperScreenConfig:
|
||||
if not path.exists(file):
|
||||
file = os.path.join(klipperscreendir, self.configfile_name)
|
||||
if not path.exists(file):
|
||||
file = os.path.expanduser("~/") + "klipper_config/%s" % (self.configfile_name)
|
||||
file = self.configfile_name.lower()
|
||||
if not path.exists(file):
|
||||
klipper_config = os.path.join(os.path.expanduser("~/"), "klipper_config")
|
||||
file = os.path.join(klipper_config, self.configfile_name)
|
||||
if not path.exists(file):
|
||||
file = os.path.join(klipper_config, self.configfile_name.lower())
|
||||
if not path.exists(file):
|
||||
file = self.default_config_path
|
||||
|
||||
@ -356,10 +361,11 @@ class KlipperScreenConfig:
|
||||
path = self.config_path
|
||||
else:
|
||||
path = os.path.expanduser("~/")
|
||||
if os.path.exists(path+"klipper_config/"):
|
||||
path = path + "klipper_config/KlipperScreen.conf"
|
||||
klipper_config = os.path.join(path, "klipper_config")
|
||||
if os.path.exists(klipper_config):
|
||||
path = os.path.join(klipper_config, "KlipperScreen.conf")
|
||||
else:
|
||||
path = path + "KlipperScreen.conf"
|
||||
path = os.path.join(path, "KlipperScreen.conf")
|
||||
|
||||
try:
|
||||
file = open(path, 'w')
|
||||
|
Loading…
x
Reference in New Issue
Block a user