ocarina/src/extra/lsmod.py

47 lines
1010 B
Python

# This is a simple test plugin, to make sure everything is working
__author__="bjschuma"
__date__ ="$Dec 27, 2009 6:35:45 PM$"
global name, app, type, path, opt
name = "lsmod"
app = "scion"
type = "extra"
path = ""
opt = []
from bt.message import write
from manager import manager
# Called every time the plugin is enabled
def open():
pass
#write("Example plugin has been started",True)
#write("Example plugin has been changed",True)
# Called every time the plugin is stopped
def close():
pass
#write("Example plugin has been stopped",True)
# Called when the plugin needs to perform some action
def run(args=None):
mods = []
if (args == None) or (("enabled" in args)==True) or (("all" in args)==True):
for plugin in manager.enabled.keys():
mods += [plugin]
if not(args==None) and ( (("disabled" in args) == True) or (("all" in args)==True) ):
for plugin in manager.disabled.keys():
mods += [plugin]
if len(mods) == 0:
return
comma = ', '
list = comma.join(mods)
write(list)