def data_retrieve(self): if self.stock: key = 's:%s' % self.basename else: key = 'u:%s' % self.basename data = datastore.get(key) if data: return json.loads(data) else: return None
def retrieve_plugin(unique_id, plugin=None): try: d = json.loads(datastore.get(unique_id)) except TypeError: return None if plugin is None: mod = load_plugin_module(d['module_basename'], d['stock']) plugin = mod.Plugin() if plugin.__class__.__name__ != d['plugin_class']: raise ValueError("plugin of class %s expected" % d['plugin_class']) plugin.from_dict(d) return plugin
def retrieve_association(association_id): try: return json.loads(datastore.get(association_id)) except TypeError: return None
def retrieve_plugin_data(unique_id): try: return json.loads(datastore.get(unique_id)) except TypeError: return None
def unstore_association(association_id, cascade=True): if cascade: li = json.loads(datastore.get(association_id)) for x in li: datastore.remove(x) datastore.remove(association_id)
def idf_installed_items(name): if not idf_exists(name): return None unique_id = _IDF_UNIQUE_ID_MAGIC + name return json.loads(datastore.get(unique_id))