Some rearranging of files, moved extract and gstreamer to tools

This commit is contained in:
bjschuma 2010-01-05 18:17:47 -05:00
parent 2c26652772
commit ad2264440e
8 changed files with 13 additions and 34 deletions

View File

@ -16,7 +16,7 @@ from bt.file import *
import settings import settings
#from tools import gstream #from tools import gstream
import gstreamer from tools import gstreamer

View File

@ -20,6 +20,7 @@ from bt.file import *
import bt.proc import bt.proc
from manager import manager from manager import manager
from tools import database from tools import database
from tools import gstreamer
settings.set("user", join(settings.get("user"),".ocarina2")) settings.set("user", join(settings.get("user"),".ocarina2"))
@ -32,6 +33,7 @@ bt.proc.setname("Ocarina2")
def open(): def open():
write("Ocarina has been started",True) write("Ocarina has been started",True)
database.init() database.init()
gstreamer.init()
# Called every time the plugin is stopped # Called every time the plugin is stopped

View File

@ -11,7 +11,7 @@ type = "core"
path = "" path = ""
opt = [] opt = []
import gstreamer from tools import gstreamer
# Called every time the plugin is enabled # Called every time the plugin is enabled

View File

@ -12,7 +12,7 @@ path = ""
opt = [] opt = []
from bt.message import write from bt.message import write
import gstreamer from tools import gstreamer
# Called every time the plugin is enabled # Called every time the plugin is enabled

View File

@ -20,6 +20,7 @@ import settings
from manager import manager from manager import manager
#from library import * #from library import *
from tools import database from tools import database
from tools import extract
#from library.scan import scan #from library.scan import scan
global root global root
@ -44,7 +45,8 @@ def scan(dir):
else: else:
write(path,True) write(path,True)
global root global root
manager.run("extract", (root,path)) #manager.run("extract", (root,path))
extract.run((root,path))
#database.insert(path) #database.insert(path)
#self.files += [path] #self.files += [path]

View File

@ -1,4 +1,4 @@
__author__="bjschuma" __author__="bjschuma"
__date__ ="$Dec 28, 2009 12:21:59 AM$" __date__ ="$Dec 28, 2009 12:21:59 AM$"
__all__ = ['database'] __all__ = ['database', 'extract']

View File

@ -4,13 +4,6 @@ __author__="bjschuma"
__date__ ="$Dec 28, 2009 10:21:06 PM$" __date__ ="$Dec 28, 2009 10:21:06 PM$"
global name, app, type, path, opt
name = "extract"
app = "ocarina"
type = "core"
path = ""
opt = []
from bt.message import write from bt.message import write
from tools import database from tools import database
import settings import settings
@ -19,7 +12,7 @@ import re
import tagpy import tagpy
global goodFiles global goodFiles
goodFiles = [] goodFiles = ["mp3", "ogg"]
global search global search
@ -35,6 +28,8 @@ def genSearch():
search += file search += file
search += ")" search += ")"
genSearch()
# Return true if the file is valid and false if it is not # Return true if the file is valid and false if it is not
def validFile(filename): def validFile(filename):
@ -46,19 +41,6 @@ def validFile(filename):
return True return True
# Called every time the plugin is enabled
def open():
#goodFile = ".*\.(mp3|ogg)"
goodFiles = ["mp3", "ogg"]
genSearch()
# Called every time the plugin is stopped
def close():
pass
def findId(table,name): def findId(table,name):
result = database.select("id",table,"name=\'"+name.replace("\'","\'\'")+"\'").fetchone() result = database.select("id",table,"name=\'"+name.replace("\'","\'\'")+"\'").fetchone()
if result == None: if result == None:

View File

@ -4,13 +4,6 @@ __author__="bjschuma"
__date__ ="$Dec 21, 2009 11:58:37 PM$" __date__ ="$Dec 21, 2009 11:58:37 PM$"
global name, app, type, path, opt
name = "gstreamer"
app = "ocarina"
type = "core"
path = ""
opt = []
from bt.file import * from bt.file import *
import gst import gst
@ -49,7 +42,7 @@ def pause():
# Called every time the plugin is enabled # Called every time the plugin is enabled
def open(): def init():
global pipeline global pipeline
pipeline = gst.Pipeline() pipeline = gst.Pipeline()
pipeline.set_state(gst.STATE_NULL) pipeline.set_state(gst.STATE_NULL)