From 588ae0692789b56607aaf15658b23f069877e481 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Thu, 26 Oct 2023 02:07:43 +0800 Subject: feat: newdocs --- src/hydrorollcore/rule.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/hydrorollcore/rule.py') diff --git a/src/hydrorollcore/rule.py b/src/hydrorollcore/rule.py index 6a89b68b..eb4b92cd 100644 --- a/src/hydrorollcore/rule.py +++ b/src/hydrorollcore/rule.py @@ -1,4 +1,16 @@ from abc import ABCMeta, abstractmethod +from enum import Enum + +__all__ = ["RuleLoadType", "Rule"] + + +class RuleLoadType(Enum): + """The Type Of Rules To Be Loaded""" + + DIR = "dir" + NAME = "name" + FILE = "file" + CLASS = "class" class Rule(metaclass=ABCMeta): @@ -9,7 +21,7 @@ class Rule(metaclass=ABCMeta): @classmethod def __subclasshook__(cls, other): if cls is Rule: - return hasattr(other, 'run') and callable(getattr(other, 'run')) + return hasattr(other, "run") and callable(getattr(other, "run")) return NotImplemented @abstractmethod -- cgit v1.2.3-70-g09d2