File: convert.py

package info (click to toggle)
indigo 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 48,936 kB
  • sloc: ansic: 332,816; cpp: 169,470; python: 20,033; java: 13,701; cs: 9,979; asm: 8,475; sql: 6,743; xml: 6,354; javascript: 1,245; sh: 555; php: 506; makefile: 54
file content (7 lines) | stat: -rw-r--r-- 291 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
with open("abbreviations.xml") as inf:
    with open("abbreviations.inc", "w") as outf:
        outf.write("static const char *default_abbreviations_xml = ")
        for line in inf:
            outf.write("\n  \"%s\\n\"" % line[:-1].replace("\"", "\\\""))
        outf.write(";\n")