コード例 #1
0
ファイル: plugin.py プロジェクト: almostearthling/when-wizard
 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
コード例 #2
0
 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
コード例 #3
0
ファイル: plugin.py プロジェクト: almostearthling/when-wizard
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
コード例 #4
0
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
コード例 #5
0
ファイル: plugin.py プロジェクト: almostearthling/when-wizard
def retrieve_association(association_id):
    try:
        return json.loads(datastore.get(association_id))
    except TypeError:
        return None
コード例 #6
0
ファイル: plugin.py プロジェクト: almostearthling/when-wizard
def retrieve_plugin_data(unique_id):
    try:
        return json.loads(datastore.get(unique_id))
    except TypeError:
        return None
コード例 #7
0
ファイル: plugin.py プロジェクト: almostearthling/when-wizard
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)
コード例 #8
0
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))
コード例 #9
0
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))
コード例 #10
0
def retrieve_association(association_id):
    try:
        return json.loads(datastore.get(association_id))
    except TypeError:
        return None
コード例 #11
0
def retrieve_plugin_data(unique_id):
    try:
        return json.loads(datastore.get(unique_id))
    except TypeError:
        return None
コード例 #12
0
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)