1 # Grab the tips from Options.xml
6 print "Extracting translatable bits from Options.xml..."
8 class Parser(XMLParser
):
11 def unknown_starttag(self
, tag
, attrs
):
12 for x
in ['title', 'label', 'end', 'unit']:
17 def handle_data(self
, data
):
18 self
.data
= self
.data
+ data
20 def unknown_endtag(self
, tag
):
21 data
= string
.strip(self
.data
)
25 def trans(self
, data
):
26 data
= string
.join(string
.split(data
, '\n'), '\\n')
27 out
.write('_("%s")\n' % data
)
34 file = open('../../Options.xml', 'rb')
35 out
= open('../tips', 'wb')
37 parser
.feed(file.read())