Concept validation must be requested
This commit is contained in:
@@ -21,8 +21,6 @@ PROPERTIES_TO_SERIALIZE = ("_id",
|
||||
"concepts")
|
||||
|
||||
|
||||
|
||||
|
||||
class ExecutionContext:
|
||||
"""
|
||||
To keep track of the execution of a request
|
||||
@@ -44,6 +42,7 @@ class ExecutionContext:
|
||||
sheerka,
|
||||
desc: str = None,
|
||||
logger=None,
|
||||
global_hints=None,
|
||||
**kwargs):
|
||||
|
||||
self._parent = None
|
||||
@@ -60,7 +59,8 @@ class ExecutionContext:
|
||||
self.children = []
|
||||
self.preprocess = None
|
||||
self.logger = logger
|
||||
self.extra_info = []
|
||||
self.local_hints = set()
|
||||
self.global_hints = set() if global_hints is None else global_hints
|
||||
|
||||
self.inputs = {} # what was the parameters of the execution context
|
||||
self.values = {} # what was produced by the execution context
|
||||
@@ -211,11 +211,12 @@ class ExecutionContext:
|
||||
self.sheerka,
|
||||
desc,
|
||||
logger,
|
||||
self.global_hints,
|
||||
**_kwargs)
|
||||
new._parent = self
|
||||
new._tab = self._tab + " " * DEBUG_TAB_SIZE
|
||||
new.preprocess = self.preprocess
|
||||
new.extra_info.extend(self.extra_info)
|
||||
new.local_hints.update(self.local_hints)
|
||||
|
||||
self.children.append(new)
|
||||
return new
|
||||
@@ -247,6 +248,15 @@ class ExecutionContext:
|
||||
def get_parent(self):
|
||||
return self._parent
|
||||
|
||||
def in_context(self, concept_key):
|
||||
if concept_key in self.local_hints:
|
||||
return True
|
||||
|
||||
if concept_key in self.global_hints:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def return_value_to_str(r):
|
||||
value = str(r.value)
|
||||
|
||||
Reference in New Issue
Block a user