File: localefix.py

package info (click to toggle)
python-cyclone 1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,388 kB
  • ctags: 1,372
  • sloc: python: 8,823; sh: 183; makefile: 13; sql: 12
file content (21 lines) | stat: -rw-r--r-- 382 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
# coding: utf-8
#
$license

import re
import sys

if __name__ == "__main__":
    try:
        filename = sys.argv[1]
        assert filename != "-"
        fd = open(filename)
    except:
        fd = sys.stdin

    line_re = re.compile(r'="([^"]+)"')
    for line in fd:
        line = line_re.sub(r"=\\1", line)
        sys.stdout.write(line)
    fd.close()