Skip to content

Commit

Permalink
fix: certain fields like LabelText cannot be ignored even it holds th…
Browse files Browse the repository at this point in the history
…e default value
  • Loading branch information
labbbirder committed Jul 20, 2021
1 parent d05cd7d commit f282e8b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,17 @@ def getHeaderOption(optionData, optionKey, valuePath, defaultValue="", replaceIn
return ""
parentValue = func()
result = str(parentValue)
if result.upper() == str(defaultValue).upper():
return ""
result = result.replace("\n", "
")
if result.find(".") != -1:
result = result.rstrip("0")
result = result.rstrip(".")

# ignoring field 'LabelText' will lead to a csd file parsing error
if not optionKey in ["LabelText","ButtonText"]:
# ignore if equals default value
if result.upper() == str(defaultValue).upper():
return ""
result = result.replace("\n", "
")
# short number
if result.find(".") != -1:
result = result.rstrip("0")
result = result.rstrip(".")

renameDict = {}
if replaceInfo != "":
Expand Down

0 comments on commit f282e8b

Please sign in to comment.