# Bryan Schumaker (8/8/2010) __all__ = ["collection"] import libsaria import tagpy call = libsaria.event.call exists = libsaria.path.exists expand = libsaria.path.expand FileRef = tagpy.FileRef LIBRARY = 0 PLAYLIST = 1 QUEUE = 2 import collection library = collection.Collection() def new_source(path, bg=True): global library path = expand(path) if not exists(path): return 0 return call("NEWSOURCE", library.scan, path) def walk_library(): global library for track in library: yield track def lib_get_attr(id, attr): global library return library.get_attr(id, attr)