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

Method getMatchingStyleNames

Lib/pagebot/base/typesetter.py:507–520  ·  view source on GitHub ↗

Answers the list of matching style, with decreasing relevance.

(self, tag)

Source from the content-addressed store, hash-verified

505 return s
506
507 def getMatchingStyleNames(self, tag):
508 """Answers the list of matching style, with decreasing relevance."""
509 revHistory = self.tagHistory[:]
510 revHistory.reverse()
511 matches = []
512 for n in range(len(revHistory)):
513 styleName = revHistory[:n+1]
514 styleName.reverse()
515 styleName = ' '.join(styleName)
516 style = self.getNamedStyle(styleName)
517 if style:
518 matches.append(styleName)
519 matches.reverse()
520 return matches
521
522 def getNamedStyle(self, styleName):
523 """Answers the named style and otherwise an empty style dict if the

Callers 1

getNodeStyleMethod · 0.95

Calls 3

getNamedStyleMethod · 0.95
reverseMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected