39 lines
693 B
Python
39 lines
693 B
Python
|
# This is a simple test plugin, to make sure everything is working
|
||
|
|
||
|
__author__="bjschuma"
|
||
|
__date__ ="$Jan 5, 2010 4:15:12 PM$"
|
||
|
|
||
|
|
||
|
global name, app, type, path, opt
|
||
|
name = "switchlib"
|
||
|
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):
|
||
|
if args == 0:
|
||
|
return
|
||
|
|
||
|
name = args[0]
|
||
|
write("Switching to: "+name)
|
||
|
|
||
|
result = database.select("id","library","name=\'"+name+"\'").fetchone()[0]
|
||
|
settings.replace("curlib",int(result))
|