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

Function cleanCondition

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

Source from the content-addressed store, hash-verified

21 commentStart = text.find("/*")
22 return text.strip()
23def cleanCondition(text : str):
24 text = text.strip()
25 text = text.replace("=\xa0=", "==")
26 text = text.replace("|\xa0|", "||")
27 text = text.replace("[\xa0", "[")
28 text = text.replace("\xa0]", "]")
29 text = text.replace("\xa0", " ")
30 text = text.replace(" ", " ")
31 text = text.replace("\n", "")
32 text = text.replace("\t", "")
33 text = text.replace("\u2212", "-")
34 text = text.replace('−', '-')
35 if (text.find("\xa0") != -1):
36 raise SyntaxError("There still is a char to replace in the condition. This must be cleaned up first.")
37 return text
38def cleanArgument(text : str):
39 text = text.strip()
40 text = text.replace("[\xa0", "[")

Callers 4

fromTextMethod · 0.85
fromTextMethod · 0.85
parseClosingWhileMethod · 0.85
fromTextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected