45 lines
823 B
Python
45 lines
823 B
Python
# This is a simple test plugin, to make sure everything is working
|
|
|
|
__author__="bjschuma"
|
|
__date__ ="$Jan 5, 2010 4:15:27 PM$"
|
|
|
|
|
|
global name, app, type, path, opt
|
|
name = "lslib"
|
|
app = "ocarina"
|
|
type = "core"
|
|
path = ""
|
|
opt = []
|
|
|
|
from bt.message import write
|
|
from tools import database
|
|
import settings
|
|
|
|
|
|
# Called every time the plugin is enabled
|
|
def open():
|
|
pass
|
|
|
|
|
|
# Called every time the plugin is stopped
|
|
def close():
|
|
pass
|
|
|
|
|
|
# Called when the plugin needs to perform some action
|
|
def run(args=None):
|
|
cur = str(settings.get("curlib"))
|
|
result = database.select("name","library","id="+str(cur)).fetchone()[0]
|
|
|
|
write("Current Library: "+result)
|
|
|
|
result = database.select("*","library").fetchall()
|
|
if len(result) == 0:
|
|
return
|
|
|
|
write("Name\tPath")
|
|
write("------------")
|
|
|
|
for lib in result:
|
|
write(lib[1]+"\t"+lib[2])
|