diff options
author | Casey Rodarmor <casey@rodarmor.com> | 2016-01-16 19:00:15 -0800 |
---|---|---|
committer | Anish Athalye <me@anishathalye.com> | 2016-02-06 15:14:35 -0500 |
commit | eeb4c284fb71dd62eaf5ee7017e23b64c2c899d7 (patch) | |
tree | 0f79d448c9f0864153d96d36bf43b263b2a15e6d /dotbot/plugin.py | |
parent | ba9e9cbe709b3a736d10dae0922b09a5eb0cde87 (diff) |
Add plugin loader
Diffstat (limited to 'dotbot/plugin.py')
-rw-r--r-- | dotbot/plugin.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/dotbot/plugin.py b/dotbot/plugin.py new file mode 100644 index 0000000..a79639e --- /dev/null +++ b/dotbot/plugin.py @@ -0,0 +1,24 @@ +from .messenger import Messenger + +class Plugin(object): + ''' + 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): + ''' + 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 |