Refactored sheerka execution flow + Enhanced log management
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
from core.sheerka import ExecutionContext
|
||||
from core.sheerka_logger import get_logger
|
||||
|
||||
|
||||
class BaseEvaluator:
|
||||
"""
|
||||
Base class to evaluate ReturnValues
|
||||
"""
|
||||
|
||||
PREFIX = "Evaluators:"
|
||||
PREFIX = "evaluators."
|
||||
enabled = True
|
||||
|
||||
def __init__(self, name, priority: int):
|
||||
self.log = get_logger(self.PREFIX + self.__class__.__name__)
|
||||
self.init_log = get_logger("init." + self.PREFIX + self.__class__.__name__)
|
||||
self.verbose_log = get_logger("verbose." + self.PREFIX + self.__class__.__name__)
|
||||
|
||||
def __init__(self, name, priority: int, enabled=True):
|
||||
self.name = self.PREFIX + name
|
||||
self.priority = priority
|
||||
self.enabled = enabled
|
||||
|
||||
|
||||
class OneReturnValueEvaluator(BaseEvaluator):
|
||||
@@ -16,10 +24,10 @@ class OneReturnValueEvaluator(BaseEvaluator):
|
||||
Evaluate one specific return value
|
||||
"""
|
||||
|
||||
def matches(self, context, return_value):
|
||||
def matches(self, context: ExecutionContext, return_value):
|
||||
pass
|
||||
|
||||
def eval(self, context, return_value):
|
||||
def eval(self, context: ExecutionContext, return_value):
|
||||
pass
|
||||
|
||||
|
||||
@@ -28,8 +36,8 @@ class AllReturnValuesEvaluator(BaseEvaluator):
|
||||
Evaluates the groups of ReturnValues
|
||||
"""
|
||||
|
||||
def matches(self, context, return_values):
|
||||
def matches(self, context: ExecutionContext, return_values):
|
||||
pass
|
||||
|
||||
def eval(self, context, return_values):
|
||||
def eval(self, context: ExecutionContext, return_values):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user