diff --git a/src/base/manager.py b/src/base/manager.py index d6bccb6d..eb254aa5 100644 --- a/src/base/manager.py +++ b/src/base/manager.py @@ -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 diff --git a/src/base/settings.py b/src/base/settings.py index f3ab8e1a..d75ca8a3 100644 --- a/src/base/settings.py +++ b/src/base/settings.py @@ -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) diff --git a/src/extra/lsmod.py b/src/extra/lsmod.py new file mode 100644 index 00000000..ce991a66 --- /dev/null +++ b/src/extra/lsmod.py @@ -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) diff --git a/src/install.sh b/src/install.sh index a89fe077..8a90a6b9 100644 --- a/src/install.sh +++ b/src/install.sh @@ -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