ocarina/src/base/bt/plugin.py

53 lines
815 B
Python

#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="bjschuma"
__date__ ="$Jan 20, 2010 6:38:42 PM$"
from message import write
import inspect
import os
class Plugin:
def __init__(self):
self.name = "plugin"
self.help = "No help message available"
self.usage = ""
self.type = "core"
def open(self):
pass
def close(self):
pass
def gethelp(self):
return self.help, self.usage
def start(self,args=None):
try:
return self.run(args)
# Find out information about the error
except:
trace = inspect.trace()
frame = trace[len(trace)-1]
filename = frame[1]
lineno = str(frame[2])
filename = filename.rsplit(os.sep,1)[1]
write(filename+" ("+lineno+")")
def run(self,args=None):
return None