Created lsmod.py in extra/ to list enabled and disabled plugins

This commit is contained in:
bjschuma 2009-12-27 18:57:48 -05:00
parent 2bd2590667
commit d80e24f6c4
4 changed files with 50 additions and 0 deletions

View File

@ -87,6 +87,8 @@ class Manager:
if (name in self.enabled)==True:
self.enabled[name].run(args)
else:
write("Plugin either not loaded or doesn't exist")
global manager

View File

@ -92,6 +92,7 @@ user = os.path.expanduser("~")
#user = os.path.join(user,".ocarina2")
set("USER", user)
set("PLUGPATH", "../core")
set("PLUGPATH", "../extra")
# Find out what platform we are running on
set("ARCH", sys.platform)

46
src/extra/lsmod.py Normal file
View File

@ -0,0 +1,46 @@
# 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)

View File

@ -3,6 +3,7 @@
mkdir /opt/scion
rsync -avz --progress base /opt/scion/
rsync -avz --progress core /opt/scion/
rsync -avz --progress extra /opt/scion/
FILE="/usr/bin/scion"
touch $FILE