MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / normalize

Function normalize

tests/conftest.py:51–59  ·  view source on GitHub ↗

Normalize a block of text to perform comparison. Strip newlines from the very beginning and very end Then split into separate lines and strip trailing whitespace from each line.

(block: str)

Source from the content-addressed store, hash-verified

49
50
51def normalize(block: str) -> list[str]:
52 """Normalize a block of text to perform comparison.
53
54 Strip newlines from the very beginning and very end Then split into separate lines and strip trailing whitespace
55 from each line.
56 """
57 assert isinstance(block, str)
58 block = block.strip("\n")
59 return [line.rstrip() for line in block.splitlines()]
60
61
62def run_cmd(app: cmd2.Cmd, cmd: str) -> tuple[list[str], list[str]]:

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…