1
0
Fork 0
mirror of synced 2024-06-02 15:31:09 -04:00
dotbot/dotbot/plugin.py
Anish Athalye 81d4a434ef Drop support for Python 2 and Python < 3.6
This patch also deletes all of the compatibility code that we no longer
need.
2023-09-09 20:57:01 -04:00

27 lines
613 B
Python

from .context import Context
from .messenger import Messenger
class Plugin:
"""
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