Package list ctdconverter / 22d41a6
Merge pull request #25 from mwalzer/feature/issue22 [fix] suggestion to fix #22 chahuistle authored 4 years ago GitHub committed 4 years ago
1 changed file(s) with 6 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
11301130 label = ""
11311131 help_text = ""
11321132 # This tag is found in some descriptions
1133 desc = str(desc).replace("#br#", " <br>")
1133 if not isinstance(desc, basestring):
1134 desc = str(desc)
1135 desc = desc.encode("utf8").replace("#br#", " <br>")
11341136 # Get rid of dots in the end
11351137 if desc.endswith("."):
1136 desc = desc.rstrip(".")
1138 desc = desc.rstrip(".")
11371139 # Check if first word is a normal word and make it uppercase
11381140 if str(desc).find(" ") > -1:
11391141 first_word, rest = str(desc).split(" ", 1)
11401142 if str(first_word).islower():
1141 # check if label has a quotient of the form a/b
1143 # check if label has a quotient of the form a/b
11421144 if first_word.find("/") != 1 :
11431145 first_word.capitalize()
11441146 desc = first_word + " " + rest
1145 label = desc
1147 label = desc.decode("utf8")
11461148
11471149 # Try to split the label if it is too long
11481150 if len(desc) > 50: