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

FIX: Fixed environment/inif file checks.

parent 3c71c27c
No related branches found
No related tags found
1 merge request!111MAINT: LinkAhead rename
Pipeline #41029 failed
...@@ -113,17 +113,21 @@ def _read_config_files(): ...@@ -113,17 +113,21 @@ def _read_config_files():
return_var = [] return_var = []
ini_user = expanduser('~/.pylinkahead.ini') ini_user = expanduser('~/.pylinkahead.ini')
ini_cwd = join(getcwd(), "pylinkahead.ini") ini_cwd = join(getcwd(), "pylinkahead.ini")
# LinkAhead rename block ##################################################
ini_user_caosdb = expanduser('~/.pycaosdb.ini')
ini_cwd_caosdb = join(getcwd(), "pycaosdb.ini")
if "PYCAOSDBINI" in environ: if "PYCAOSDBINI" in environ:
raise RuntimeError("You have set the old PYCAOSDBINI environment variable. Please use the " raise RuntimeError("\n\nYou have set the old PYCAOSDBINI environment variable. Please use "
"new PYLINKAHEADINI variable instead and unset the old one.") "the new PYLINKAHEADINI variable instead and unset the old one.")
if os.path.exists(ini_user): if os.path.exists(ini_user_caosdb):
raise RuntimeError("You have a config file with the old naming scheme (pycaosdb.ini). " raise RuntimeError("\n\nYou have a config file with the old naming scheme (pycaosdb.ini). "
f"Please use the new version and rename\n" f"Please use the new version and rename\n"
f" {ini_user}\nto\n {expanduser('~/.pylinkahead.ini')}") f" {ini_user_caosdb}\nto\n {ini_user}")
if os.path.exists(ini_cwd): if os.path.exists(ini_cwd_caosdb):
raise RuntimeError("You have a config file with the old naming scheme (pycaosdb.ini). " raise RuntimeError("\n\nYou have a config file with the old naming scheme (pycaosdb.ini). "
f"Please use the new version and rename\n" f"Please use the new version and rename\n"
f" {ini_cwd}\nto\n {join(getcwd(), 'pylinkahead.ini')}") f" {ini_cwd_caosdb}\nto\n {ini_cwd}")
# End: LinkAhead rename block ##################################################
if "PYLINKAHEADINI" in environ: if "PYLINKAHEADINI" in environ:
return_var.extend(configure(expanduser(environ["PYLINKAHEADINI"]))) return_var.extend(configure(expanduser(environ["PYLINKAHEADINI"])))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment