fix config file path list

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2022-01-11 14:15:05 +03:00
parent 28f7c09f83
commit 3c2cdb10ac
Signed by untrusted user: r4sas
GPG Key ID: 66F6C87B98EBCFE2

View File

@ -7,10 +7,14 @@ from pbincli.utils import PBinCLIException, PBinCLIError, validate_url
CONFIG_PATHS = [ CONFIG_PATHS = [
os.path.join(".", "pbincli.conf", ), os.path.join(".", "pbincli.conf", ),
os.path.join(os.getenv("HOME") or "~", ".config", "pbincli", "pbincli.conf"), os.path.join(os.getenv("HOME") or "~", ".config", "pbincli", "pbincli.conf")
os.path.join(os.getenv("APPDATA"), "pbincli", "pbincli.conf"),
] ]
if sys.platform == "win32":
CONFIG_PATHS.append(os.path.join(os.getenv("APPDATA"), "pbincli", "pbincli.conf"))
elif sys.platform == "darwin":
CONFIG_PATHS.append(os.path.join(os.getenv("HOME") or "~", "Library", "Application Support", "pbincli", "pbincli.conf"))
def read_config(filename): def read_config(filename):
"""Read config variables from a file""" """Read config variables from a file"""
settings = {} settings = {}