libsaria: Do filtering through sources

This allows me to set filter text and trigger a callback.
This commit is contained in:
Bryan Schumaker 2011-05-22 09:24:53 -04:00
parent ac0f23ab80
commit 3f8cba6f16
2 changed files with 10 additions and 0 deletions

View File

@ -44,3 +44,8 @@ def library_updated():
on_queue_changed = null_cb
def queue_changed():
on_queue_changed()
on_filter = null_cb
def refilter():
print "filtering..."
on_refilter()

View File

@ -1,6 +1,7 @@
# Bryan Schumaker (8/8/2010)
import libsaria
from libsaria import callbacks
exists = libsaria.path.exists
expand = libsaria.path.expand
@ -41,6 +42,10 @@ def get_attrs(*attrs):
return library.get_attrs(cur_id, *attrs)
return -1
def filter(text):
library.filter(text)
callbacks.refilter()
def is_visible(id):
return library.is_visible(id)