Skip to content
Snippets Groups Projects
Verified Commit 6760a1e3 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Cleaned up the code a bit.

For #163
parent cbefcbb1
Branches f-docs-pylib
No related tags found
1 merge request!111MAINT: LinkAhead rename
Pipeline #40920 failed
......@@ -111,25 +111,24 @@ def _read_config_files():
"""
return_var = []
ini_user = expanduser('~/.pylinkahead.ini')
ini_cwd = join(getcwd(), "pylinkahead.ini")
if "PYCAOSDBINI" in environ:
raise RuntimeError("You have set the old PYCAOSDBINI environment variable. Please use the "
"new PYLINKAHEADINI variable instead and unset the old one.")
if os.path.exists(expanduser('~/.pycaosdb.ini')):
if os.path.exists(ini_user):
raise RuntimeError("You have a config file with the old naming scheme (pycaosdb.ini). "
f"Please use the new version and rename\n"
f"{expanduser('~/.pycaosdb.ini')}\n"
f"to\n{expanduser('~/.pylinkahead.ini')}")
if os.path.exists(join(getcwd(), "pycaosdb.ini")):
f" {ini_user}\nto\n {expanduser('~/.pylinkahead.ini')}")
if os.path.exists(ini_cwd):
raise RuntimeError("You have a config file with the old naming scheme (pycaosdb.ini). "
f"Please use the new version and rename\n"
f"{join(getcwd(), 'pycaosdb.ini')}\n"
f"to\n{join(getcwd(), 'pylinkahead.ini')}")
f" {ini_cwd}\nto\n {join(getcwd(), 'pylinkahead.ini')}")
if "PYLINKAHEADINI" in environ:
return_var.extend(configure(expanduser(environ["PYLINKAHEADINI"])))
else:
return_var.extend(configure(expanduser('~/.pylinkahead.ini')))
if isfile(join(getcwd(), "pylinkahead.ini")):
return_var.extend(configure(join(getcwd(), "pylinkahead.ini")))
return_var.extend(configure(ini_user))
if isfile(ini_cwd):
return_var.extend(configure(ini_cwd))
return return_var
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment