r1532: Removed rox-base from manual.
[rox-filer.git] / ROX-Filer / src / po / tips.py
bloba7b13091cc20ed4f135d3fb9375897f1b6bcb5d5
1 # Grab the tips from Options.xml
3 from xmllib import *
4 import string, os
6 print "Extracting translatable bits from Options.xml..."
8 class Parser(XMLParser):
9 data = ""
11 def unknown_starttag(self, tag, attrs):
12 for x in ['title', 'label', 'end', 'unit']:
13 if attrs.has_key(x):
14 self.trans(attrs[x])
15 self.data = ""
17 def handle_data(self, data):
18 self.data = self.data + data
20 def unknown_endtag(self, tag):
21 data = string.strip(self.data)
22 if data:
23 self.trans(data)
25 def trans(self, data):
26 data = string.join(string.split(data, '\n'), '\\n')
27 out.write('_("%s")\n' % data)
29 try:
30 os.chdir("po")
31 except OSError:
32 pass
34 file = open('../../Options.xml', 'rb')
35 out = open('../tips', 'wb')
36 parser = Parser()
37 parser.feed(file.read())
38 file.close()
39 parser.close()
40 out.close()