Encodes a string for SGML/XML/HTML
(x, codec='ascii')
| 159 | |
| 160 | # enc |
| 161 | def enc(x, codec='ascii'): |
| 162 | """Encodes a string for SGML/XML/HTML""" |
| 163 | x = x.replace('&','&').replace('>','>').replace('<','<').replace('"','"') |
| 164 | return x.encode(codec, 'xmlcharrefreplace') |
| 165 | |
| 166 | def bbox2str((x0,y0,x1,y1)): |
| 167 | return '%.3f,%.3f,%.3f,%.3f' % (x0, y0, x1, y1) |
no test coverage detected