aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/hydrorollcore/rule.py
blob: 6a89b68bcccd4b27a07b17e3ff83abbbd2ae2405 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from abc import ABCMeta, abstractmethod


class Rule(metaclass=ABCMeta):
    @abstractmethod
    def __init__(self):
        pass

    @classmethod
    def __subclasshook__(cls, other):
        if cls is Rule:
            return hasattr(other, 'run') and callable(getattr(other, 'run'))
        return NotImplemented

    @abstractmethod
    async def run(self):
        pass