~ubuntu-branches/ubuntu/wily/psi/wily-proposed

« back to all changes in this revision

Viewing changes to admin/update_options_ts.py

  • Committer: Package Import Robot
  • Author(s): Jan Niehusmann
  • Date: 2014-07-01 21:49:34 UTC
  • mfrom: (6.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20140701214934-gt4dkgm94byi4vnn
Tags: 0.15-1
* New upstream version
* set debhelper compat level to 9
* set Standards-Version to 3.9.5 (no further changes)
* add lintian override regarding license-problem-non-free-RFC
* use qconf to regenerate configure script
* implement hardening using buildflags instead of hardening-wrapper

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
from xml.dom.minidom import parse, parseString
 
4
import xml.dom
 
5
import sys
 
6
 
 
7
def rec_parse(node, context): # node : xml.dom.Node
 
8
        for i in node.childNodes:
 
9
                if i.nodeType == xml.dom.Node.ELEMENT_NODE:
 
10
                        if i.hasAttribute("comment"):
 
11
                                print 'QT_TRANSLATE_NOOP("' + context + '","' + i.getAttribute("comment") + '");';
 
12
                        rec_parse(i,context)
 
13
 
 
14
 
 
15
if len(sys.argv) != 2:
 
16
        print "usage: %s options.xml > output.cpp" % sys.argv[0]
 
17
        sys.exit(1)
 
18
 
 
19
print "#define QT_TRANSLATE_NOOP(a,b)"
 
20
 
 
21
dom = parse(sys.argv[1]) # parse an XML file by name
 
22
 
 
23
toplevel = dom.getElementsByTagName("psi")[0]
 
24
options = toplevel.getElementsByTagName("options")[0]
 
25
 
 
26
shortcuts = options.getElementsByTagName("shortcuts")[0]
 
27
rec_parse(shortcuts,"Shortcuts")