MCPcopy Create free account
hub / github.com/IENT/YUView / cleanComment

Function cleanComment

tools/standardTextToCode/parseTables.py:48–62  ·  view source on GitHub ↗
(text : str)

Source from the content-addressed store, hash-verified

46 raise SyntaxError("There still is a char to replace in the argument. This must be cleaned up first.")
47 return text
48def cleanComment(text : str):
49 text = text.strip()
50 text = text.replace("=\xa0=", "==")
51 text = text.replace("[\xa0", "[")
52 text = text.replace("\xa0]", "]")
53 text = text.replace("\xa0", " ")
54 text = text.replace("\n", " ")
55 text = text.replace("\t", "")
56 text = text.replace("( ", "(")
57 text = text.replace(" )", ")")
58 text = text.replace("\u2212", "-")
59 text = text.replace('−', '-')
60 if (text.find("\xa0") != -1):
61 raise SyntaxError("There still is a char to replace in the comment. This must be cleaned up first.")
62 return text
63def cleanConditionPart(text : str):
64 text = text.strip()
65 text = text.replace("\xa0−\xa0", " - ")

Callers 1

fromTextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected