ocarina/src/core/scan.py

50 lines
853 B
Python

# This is a simple test plugin, to make sure everything is working
__author__="bjschuma"
__date__ ="$Dec 27, 2009 8:07:18 PM$"
global name, app, type, path, opt
name = "test"
app = "scion"
type = "core"
path = ""
opt = []
from bt.message import write
from bt.file import *
from library import *
#from library.scan import scan
# Called every time the plugin is enabled
def open():
pass
# Called every time the plugin is stopped
def close():
pass
# Performs the actual scanning
def scan(dir):
files = ls(dir)
for file in files:
path = join(dir,file)
if checkDir(path)==True:
scan(path)
else:
write(path,True)
#self.files += [path]
# Called to scan a directory. Performs initial path expansion before traversing
def run(args=None):
if args == None:
return
space = ' '
path = expandPath( space.join(args) )
scan(path)