Created lsmod.py in extra/ to list enabled and disabled plugins
This commit is contained in:
parent
2bd2590667
commit
d80e24f6c4
|
@ -87,6 +87,8 @@ class Manager:
|
||||||
|
|
||||||
if (name in self.enabled)==True:
|
if (name in self.enabled)==True:
|
||||||
self.enabled[name].run(args)
|
self.enabled[name].run(args)
|
||||||
|
else:
|
||||||
|
write("Plugin either not loaded or doesn't exist")
|
||||||
|
|
||||||
|
|
||||||
global manager
|
global manager
|
||||||
|
|
|
@ -92,6 +92,7 @@ user = os.path.expanduser("~")
|
||||||
#user = os.path.join(user,".ocarina2")
|
#user = os.path.join(user,".ocarina2")
|
||||||
set("USER", user)
|
set("USER", user)
|
||||||
set("PLUGPATH", "../core")
|
set("PLUGPATH", "../core")
|
||||||
|
set("PLUGPATH", "../extra")
|
||||||
|
|
||||||
# Find out what platform we are running on
|
# Find out what platform we are running on
|
||||||
set("ARCH", sys.platform)
|
set("ARCH", sys.platform)
|
||||||
|
|
|
@ -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)
|
|
@ -3,6 +3,7 @@
|
||||||
mkdir /opt/scion
|
mkdir /opt/scion
|
||||||
rsync -avz --progress base /opt/scion/
|
rsync -avz --progress base /opt/scion/
|
||||||
rsync -avz --progress core /opt/scion/
|
rsync -avz --progress core /opt/scion/
|
||||||
|
rsync -avz --progress extra /opt/scion/
|
||||||
|
|
||||||
FILE="/usr/bin/scion"
|
FILE="/usr/bin/scion"
|
||||||
touch $FILE
|
touch $FILE
|
||||||
|
|
Loading…
Reference in New Issue