diff --git a/script/local.py b/script/local.py index 0c5de79..e85b9a4 100644 --- a/script/local.py +++ b/script/local.py @@ -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):