MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / format_direction_label

Function format_direction_label

agents/master-coordinator/main.py:185–199  ·  view source on GitHub ↗

Format internal topic keys into user-facing labels.

(direction: str)

Source from the content-addressed store, hash-verified

183
184
185def format_direction_label(direction: str) -> str:
186 """Format internal topic keys into user-facing labels."""
187 formatter = getattr(direction_lexicon, "format_direction_label", None)
188 if callable(formatter):
189 return str(formatter(direction, prefer_chinese=True) or direction)
190 entry = get_direction_entry(direction)
191 if entry:
192 return str(entry.get("name_cn") or entry.get("name") or direction)
193 if direction in DIRECTION_TRANSLATIONS:
194 return DIRECTION_TRANSLATIONS[direction]
195 if any(separator in direction for separator in ("-", "_")):
196 return direction.replace("_", " ").replace("-", " ").title()
197 if re.fullmatch(r"[a-z0-9]+", direction):
198 return direction.upper() if len(direction) <= 4 else direction.title()
199 return direction
200
201
202def is_displayable_author_name(author_name: str) -> bool:

Calls 2

get_direction_entryFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected