1
0
Fork 0
mirror of synced 2024-12-21 21:51:08 -05:00
dotbot/dotbot/plugin.py
Anish Athalye f52bbd1eec Add default options
This feature was implemented with feedback from Aleks Kamko
<aykamko@gmail.com> and Casey Rodarmor <casey@rodarmor.com>.
2016-03-03 09:42:50 -05:00

25 lines
620 B
Python

from .messenger import Messenger
from .context import Context
class Plugin(object):
'''
Abstract base class for commands that process directives.
'''
def __init__(self, context):
self._context = context
self._log = Messenger()
def can_handle(self, directive):
'''
Returns true if the Plugin can handle the directive.
'''
raise NotImplementedError
def handle(self, directive, data):
'''
Executes the directive.
Returns true if the Plugin successfully handled the directive.
'''
raise NotImplementedError