i18n/mki18n.py
changeset 2418 5587c490a070
parent 2350 9f7028ab8294
child 2439 f0a040f1de1b
equal deleted inserted replaced
2417:316ee9fff395 2418:5587c490a070
   484         '--moTarget': 'moTarget',
   484         '--moTarget': 'moTarget',
   485     }
   485     }
   486     exit_code = 1
   486     exit_code = 1
   487     try:
   487     try:
   488         optionList, pargs = getopt.getopt(sys.argv[1:], validOptions, validLongOptions)
   488         optionList, pargs = getopt.getopt(sys.argv[1:], validOptions, validLongOptions)
   489     except getopt.GetoptError, e:
   489     except getopt.GetoptError as e:
   490         printUsage(e[0])
   490         printUsage(e[0])
   491         sys.exit(1)
   491         sys.exit(1)
   492     for (opt, val) in optionList:
   492     for (opt, val) in optionList:
   493         if opt == '-h':
   493         if opt == '-h':
   494             printUsage()
   494             printUsage()
   510         print("Application domain used is: '%s'" % option['domain'])
   510         print("Application domain used is: '%s'" % option['domain'])
   511     if option['po']:
   511     if option['po']:
   512         try:
   512         try:
   513             makePO(appDirPath, option['domain'], option['verbose'])
   513             makePO(appDirPath, option['domain'], option['verbose'])
   514             exit_code = 0
   514             exit_code = 0
   515         except IOError, e:
   515         except IOError as e:
   516             printUsage(e[1] + '\n   You must write a file app.fil that contains the list of all files to parse.')
   516             printUsage(e[1] + '\n   You must write a file app.fil that contains the list of all files to parse.')
   517     if option['mo']:
   517     if option['mo']:
   518         makeMO(appDirPath, option['moTarget'], option['domain'], option['verbose'], option['forceEnglish'])
   518         makeMO(appDirPath, option['moTarget'], option['domain'], option['verbose'], option['forceEnglish'])
   519         exit_code = 0
   519         exit_code = 0
   520     sys.exit(exit_code)
   520     sys.exit(exit_code)