Commit a20d2ee8 authored by Emmanuel Papillon's avatar Emmanuel Papillon
Browse files

* modify script_directory default

parent 5f9159dc
......@@ -69,7 +69,7 @@ def findmotref(axis):
print("Reference user position not configured. No change.")
else:
ans = _yes_no(
"Do you want to set user position to {0:g} ??".format(refcfg["user"]), False,
"Do you want to set user position to {0:g} ??".format(refcfg["user"]), False
)
if ans is True:
user_pos = refcfg["user"] + axis.sign * offset
......@@ -97,7 +97,8 @@ def _yes_no(msg, flag):
if ans.upper() in ("YES", "Y"):
return True
return False
def _get_motref_config(axis):
axiscfg = axis.config.config_dict
refcfg = dict()
......
......@@ -5,9 +5,13 @@ import sys
from bliss import current_session
from bliss.config.settings import SimpleSetting
SCRIPT_HOME = SimpleSetting("%s:script_home"%current_session.name, default_value=".")
SCRIPT_HOME = SimpleSetting(
"%s:script_home" % current_session.name,
default_value="%s/bliss_scripts" % os.getenv("HOME"),
)
__all__ = ["script_directory", "run_script"]
__all__ = [ "script_directory", "run_script" ]
def script_directory(new_dir=None):
if new_dir is not None:
......@@ -17,6 +21,7 @@ def script_directory(new_dir=None):
else:
return SCRIPT_HOME.get()
def run_script(scriptname):
script_dir = os.path.abspath(SCRIPT_HOME.get())
(filename, fileext) = os.path.splitext(scriptname)
......@@ -37,4 +42,3 @@ def run_script(scriptname):
if k.startswith("_"):
continue
current_session.env_dict[k] = globals_dict[k]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment