File indexing completed on 2024-04-21 05:42:00

0001 #!/usr/bin/env python
0002 '''This script reads timezone list as its first argument
0003 or from /usr/share/zoneinfo/zone.tab, and converts it
0004 to a PO file template.
0005 
0006 This is free software, released under GPL.
0007 Author: Lukas Tinkl <lukas@kde.org>, 2002
0008 '''
0009 
0010 import sys
0011 import fileinput
0012 
0013 def makePOT(_file):
0014   for line in fileinput.input(_file):
0015     if (line[0]=='#'): #skip comments
0016       continue
0017     section=line.strip().split('\t')[2] #third field, tab separated
0018     newline='msgid \"' + section+ '\"\n' #msgid
0019     newline+='msgstr \"\"\n' #msgstr
0020     print(newline) #output to stdout
0021 
0022 if __name__ == '__main__':
0023   makePOT(sys.argv[1:] or "/usr/share/zoneinfo/zone.tab")