# Bryan Schumaker (5 / 20 / 2011)

import libsaria
import library
import update
import tree
import index

# Function pointers for conveniance
add_path    = library.add_path
list_paths  = library.list_paths
get_attrs   = library.get_attrs
all_attrs   = library.all_attrs
list_ids    = tree.list_ids
filter      = index.filter
is_visible  = index.is_visible
num_visible = index.num_visible

library.load()
tree.make_tree()
index.reindex()

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()
	refresh()
