def config_read(key): '''Read the given configuration value Only read from the registry once. This is both technically efficient and keeps parallel running instances of CellProfiler from overwriting each other's values for things like the current output directory. Decode escaped config sequences too. ''' global __cached_values if not __is_headless: # # Keeps popup box from appearing during testing I hope # import wx shutup = wx.LogNull() if __cached_values.has_key(key): return __cached_values[key] if get_config().Exists(key): value = get_config().Read(key) else: value = None if value is not None: value = utf16decode(value) __cached_values[key] = value return value
def config_read(key): '''Read the given configuration value Decode escaped config sequences too. ''' if not __is_headless: # # Keeps popup box from appearing during testing I hope # import wx shutup = wx.LogNull() value = get_config().Read(key) if value is None: return None return utf16decode(value)