[Draft] Remove obsolete decode code (#9106)
This commit is contained in:
@@ -165,34 +165,16 @@ def get_text(plane, techdraw,
|
||||
fontname, angle, base, flip)
|
||||
|
||||
if len(text) == 1:
|
||||
try:
|
||||
_t = text[0].replace("&", "&").replace("<", "<")
|
||||
svg += _t.replace(">", ">")
|
||||
except Exception:
|
||||
# TODO: trap only specific exception; what is the problem?
|
||||
# Bad UTF8 string specification? This can be removed
|
||||
# once the code is only used with Python 3.
|
||||
_t = text[0].decode("utf8")
|
||||
_t = _t.replace("&", "&").replace("<", "<")
|
||||
svg += _t.replace(">", ">")
|
||||
_t = text[0].replace("&", "&").replace("<", "<")
|
||||
svg += _t.replace(">", ">")
|
||||
else:
|
||||
for i in range(len(text)):
|
||||
if i == 0:
|
||||
svg += '<tspan>'
|
||||
else:
|
||||
svg += '<tspan x="0" dy="{}">'.format(linespacing)
|
||||
|
||||
try:
|
||||
_t = text[i].replace("&", "&").replace("<", "<")
|
||||
svg += _t.replace(">", ">")
|
||||
except Exception:
|
||||
# TODO: trap only specific exception; what is the problem?
|
||||
# Bad UTF8 string specification? This can be removed
|
||||
# once the code is only used with Python 3.
|
||||
_t = text[i].decode("utf8")
|
||||
_t = _t.replace("&", "&").replace("<", "<")
|
||||
svg += _t.replace(">", ">")
|
||||
|
||||
_t = text[i].replace("&", "&").replace("<", "<")
|
||||
svg += _t.replace(">", ">")
|
||||
svg += '</tspan>\n'
|
||||
svg += '</text>\n'
|
||||
return svg
|
||||
|
||||
Reference in New Issue
Block a user