56 lines
978 B
Python
56 lines
978 B
Python
|
# This is a simple test plugin, to make sure everything is working
|
||
|
|
||
|
__author__="bjschuma"
|
||
|
__date__ ="$Jan 1, 2010 6:33:06 PM$"
|
||
|
|
||
|
|
||
|
global name, app, type, path, opt
|
||
|
name = "create"
|
||
|
app = "ocarina"
|
||
|
type = "core"
|
||
|
path = ""
|
||
|
opt = []
|
||
|
|
||
|
from bt.message import write
|
||
|
from bt.file import *
|
||
|
from tools import database
|
||
|
from manager import manager
|
||
|
import settings
|
||
|
|
||
|
|
||
|
# Called every time the plugin is enabled
|
||
|
def open():
|
||
|
pass
|
||
|
|
||
|
|
||
|
# Called every time the plugin is stopped
|
||
|
def close():
|
||
|
pass
|
||
|
|
||
|
|
||
|
def library(args):
|
||
|
name = "Default"
|
||
|
root = ""
|
||
|
if len(args) >= 1:
|
||
|
name = args[0]
|
||
|
if len(args) >= 2:
|
||
|
space = ' '
|
||
|
root = expandPath( space.join(args[1:]) )
|
||
|
|
||
|
#next = settings.get("nextlib")
|
||
|
database.open()
|
||
|
next = database.count('library')
|
||
|
database.insert('library',(next,name,root) )
|
||
|
database.close()
|
||
|
|
||
|
if not root == "":
|
||
|
manager.run("scan",[root])
|
||
|
|
||
|
|
||
|
# Called when the plugin needs to perform some action
|
||
|
def run(args=None):
|
||
|
l = len(args)
|
||
|
if args[0] == "library":
|
||
|
library(args[1:])
|
||
|
|