Script execution

This commit is contained in:
gac-x04sa
2018-10-31 10:58:30 +01:00
parent 20e22e6599
commit 3c442bdf59
+5 -1
View File
@@ -76,7 +76,7 @@ def get_geometry():
"""
"""
setting = get_setting(GEOMETRY_PREFERENCE)
if len(setting.strip() == 0):
if setting is None or (len(setting.strip()) == 0):
return None
return setting
@@ -85,6 +85,10 @@ def set_geometry(value, apply = None):
"""
if value is None or len(value.strip() == 0):
set_setting(GEOMETRY_PREFERENCE, "" )
for name in "wavelength", "hkl_group", "h", "k", "l":
dev = get_device(name)
if dev is not None:
remove_device(dev)
return
filename = get_context().setup.expandPath("{script}/geometry/"+ str(value)+".py")
if not os.path.isfile(filename):