30 lines
531 B
Python
30 lines
531 B
Python
# Basic plugin class
|
|
|
|
__author__="bjschuma"
|
|
__date__ ="$Feb 24, 2010 6:18:54 PM$"
|
|
|
|
|
|
from bt import plugin
|
|
from bt.message import write
|
|
import session
|
|
|
|
|
|
class Plugin(plugin.Plugin):
|
|
def __init__(self):
|
|
plugin.Plugin.__init__(self)
|
|
self.help = "Use to run python commands"
|
|
self.usage = "exec [command, file file.py]"
|
|
|
|
|
|
def run(self, args=None):
|
|
if args==None:
|
|
write(self.usage)
|
|
return
|
|
|
|
join = ' '
|
|
if (len(args)>1) and (args[0].lower()=="file"):
|
|
execfile(join.join(args[1:]))
|
|
return
|
|
exec(join.join(args))
|
|
|