summaryrefslogtreecommitdiff
path: root/dotbot/plugin.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-11-15 15:24:24 +0100
committerAnton Khirnov <anton@khirnov.net>2020-11-15 15:24:24 +0100
commit5c0a76908b1eb77a06e4a9d95e377110f20dc05c (patch)
treeb145b6be39e457e6e898f859002391524e183576 /dotbot/plugin.py
parent7eabd2856753c73a818159e7cb3316148ca600dc (diff)
plugin: reduce code duplication
Factor out supported directive checking, drop redundant checking in handle().
Diffstat (limited to 'dotbot/plugin.py')
-rw-r--r--dotbot/plugin.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/dotbot/plugin.py b/dotbot/plugin.py
index 56d4da8..5e2c923 100644
--- a/dotbot/plugin.py
+++ b/dotbot/plugin.py
@@ -6,6 +6,8 @@ class Plugin(object):
Abstract base class for commands that process directives.
'''
+ _directive = None
+
def __init__(self, context):
self._context = context
self._log = Messenger()
@@ -14,7 +16,7 @@ class Plugin(object):
'''
Returns true if the Plugin can handle the directive.
'''
- raise NotImplementedError
+ return directive == self._directive
def handle(self, directive, data):
'''