1
0
Fork 0
mirror of synced 2024-06-15 13:51:08 -04:00
dotbot/dotbot/condition.py

28 lines
641 B
Python
Raw Normal View History

import dotbot
import dotbot.util
from .messenger import Messenger
class Condition(object):
"""
Abstract base class for conditions that test whether dotbot should execute tasks/actions
"""
def __init__(self, context):
self._context = context
self._log = Messenger()
def can_handle(self, directive):
"""
Returns true if the Condition can handle the directive.
"""
raise NotImplementedError
def handle(self, directive, data):
"""
Executes the test.
Returns the boolean value returned by the test
"""
raise NotImplementedError