Script execution
This commit is contained in:
+5
-1
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user