libsaria: Remove path from library

I need to delete it, save the library, and rebulid the tree and index.
This commit is contained in:
Bryan Schumaker 2011-06-18 11:22:24 -04:00
parent bf9ef7666c
commit e6ba5c3139
2 changed files with 16 additions and 3 deletions

View File

@ -20,12 +20,19 @@ library.load()
tree.make_tree()
index.reindex()
def update_lib():
update.update()
def refresh():
tree.make_tree()
index.reindex()
libsaria.callbacks.library_updated()
def update_lib():
update.update()
refresh()
def rm_path(path):
library.rm_path(path)
refresh()
def reset():
library.reset()
tree.make_tree()
refresh()

View File

@ -39,6 +39,12 @@ def add_path(path):
lib_dict.setdefault(path, dict())
unlock_library()
def rm_path(path):
lock_library()
del lib_dict[path]
save()
unlock_library()
def list_paths():
res = []
lock_library()