Ejemplo n.º 1
0
def idf_remove(name):
    if not idf_exists(name):
        return 0
    proxy = when_proxy()
    if proxy is None:
        return 0
    items = idf_installed_items(name)
    conditions = [x for x in items if x.startswith('conditions' + ':')]
    tasks = [x for x in items if x.startswith('tasks' + ':')]
    sighandlers = [x for x in items if x.startswith('sighandlers' + ':')]
    error = 0
    for item in conditions:
        if not proxy.RemoveItem(item):
            error += 1
    for item in tasks:
        if not proxy.RemoveItem(item):
            error += 1
    for item in sighandlers:
        if not proxy.RemoveItem(item):
            error += 1
    unique_id = _IDF_UNIQUE_ID_MAGIC + name
    if not error:
        datastore.remove(unique_id)
        return 1
    else:
        return -error
Ejemplo n.º 2
0
def idf_remove(name):
    if not idf_exists(name):
        return 0
    proxy = when_proxy()
    if proxy is None:
        return 0
    items = idf_installed_items(name)
    conditions = [x for x in items if x.startswith('conditions' + ':')]
    tasks = [x for x in items if x.startswith('tasks' + ':')]
    sighandlers = [x for x in items if x.startswith('sighandlers' + ':')]
    error = 0
    for item in conditions:
        if not proxy.RemoveItem(item):
            error += 1
    for item in tasks:
        if not proxy.RemoveItem(item):
            error += 1
    for item in sighandlers:
        if not proxy.RemoveItem(item):
            error += 1
    unique_id = _IDF_UNIQUE_ID_MAGIC + name
    if not error:
        datastore.remove(unique_id)
        return 1
    else:
        return -error
Ejemplo n.º 3
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)
Ejemplo n.º 4
0
def unstore_plugin(plugin_id):
    datastore.remove(plugin_id)
Ejemplo n.º 5
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)
Ejemplo n.º 6
0
def unstore_plugin(plugin_id):
    datastore.remove(plugin_id)