mirror of
1
0
Fork 0
dotbot/dotbot/plugin.py

25 lines
612 B
Python
Raw Normal View History

2016-01-16 22:00:15 -05:00
from .messenger import Messenger
2014-03-19 23:07:30 -04:00
2016-01-16 22:00:15 -05:00
class Plugin(object):
2014-03-19 23:07:30 -04:00
'''
Abstract base class for commands that process directives.
'''
def __init__(self, base_directory):
self._base_directory = base_directory
self._log = Messenger()
def can_handle(self, directive):
'''
2016-01-16 22:00:15 -05:00
Returns true if the Plugin can handle the directive.
2014-03-19 23:07:30 -04:00
'''
raise NotImplementedError
def handle(self, directive, data):
'''
Executes the directive.
2016-01-16 22:00:15 -05:00
Returns true if the Plugin successfully handled the directive.
2014-03-19 23:07:30 -04:00
'''
raise NotImplementedError