MCPcopy Create free account
hub / github.com/PageBot/PageBot / evaluate

Method evaluate

Lib/pagebot/elements/element.py:4786–4802  ·  view source on GitHub ↗

Evaluates the content of element `e` with all the conditions.

(self, score=None)

Source from the content-addressed store, hash-verified

4784 e.compose(doc, publication)
4785
4786 def evaluate(self, score=None):
4787 """Evaluates the content of element `e` with all the conditions."""
4788 if score is None:
4789 score = Score()
4790
4791 # Can be None or empty.
4792 if self.conditions:
4793 # Skip in case there are no conditions in the style.
4794 for condition in self.conditions:
4795 condition.evaluate(self, score)
4796
4797 # Also works if showing element is not a container.
4798 for e in self.elements:
4799 if e.show:
4800 e.evaluate(score)
4801
4802 return score
4803
4804 def solve(self, score=None):
4805 """Evaluates the content of element e with the all the conditions. The

Callers 1

getMetricsStringMethod · 0.95

Calls 1

ScoreClass · 0.90

Tested by

no test coverage detected