Finished re-implementing core

This commit is contained in:
bjschuma 2010-01-21 14:28:57 -05:00
parent 9c86ab0ba3
commit 7de5fbfd39
3 changed files with 25 additions and 6 deletions

View File

@ -67,15 +67,12 @@ class Manager:
return
## Disable the plugin and pop from sys.modules
reenable = self.disablePlugin(name)
for index,p in self.disabled:
if p.name==name:
break
self.disabled.pop(index)
del self.disabled[name]
#reload(self.disabled[name])
reload(sys.modules[name])
p = sys.modules[name].Plugin()
self.disabled+=[p]
self.disabled[name]=p
if reenable == True:
self.enablePlugin(name)

View File

@ -14,7 +14,6 @@ class Plugin(plugin.Plugin):
plugin.Plugin.__init__(self)
self.help = "Returns a short description of the plugin"
def run(self, args=None):
if args == None:
plugin = "help"

23
src/core/reload.py Normal file
View File

@ -0,0 +1,23 @@
# Basic plugin class
__author__="bjschuma"
__date__ ="$Jan 21, 2010 12:11:23 PM$"
from bt import plugin
from manager import manager
class Plugin(plugin.Plugin):
def __init__(self):
plugin.Plugin.__init__(self)
self.help = "Closes, then reopens a plugin"
def run(self, args=None):
if args == None:
return
for plugin in args:
manager.reloadPlugin(plugin)