i18n/mki18n.py
changeset 1844 b126c2f61bb6
parent 1832 0f1081928d65
child 1847 6198190bc121
equal deleted inserted replaced
1843:4bec5768afbb 1844:b126c2f61bb6
   458         '-p':         'po',
   458         '-p':         'po',
   459         '-v':         'verbose',
   459         '-v':         'verbose',
   460         '--domain':   'domain',
   460         '--domain':   'domain',
   461         '--moTarget': 'moTarget',
   461         '--moTarget': 'moTarget',
   462     }
   462     }
   463 
   463     exit_code = 1
   464     try:
   464     try:
   465         optionList, pargs = getopt.getopt(sys.argv[1:], validOptions, validLongOptions)
   465         optionList, pargs = getopt.getopt(sys.argv[1:], validOptions, validLongOptions)
   466     except getopt.GetoptError, e:
   466     except getopt.GetoptError, e:
   467         printUsage(e[0])
   467         printUsage(e[0])
   468         sys.exit(1)
   468         sys.exit(1)
   486     if option['verbose']:
   486     if option['verbose']:
   487         print("Application domain used is: '%s'" % option['domain'])
   487         print("Application domain used is: '%s'" % option['domain'])
   488     if option['po']:
   488     if option['po']:
   489         try:
   489         try:
   490             makePO(appDirPath, option['domain'], option['verbose'])
   490             makePO(appDirPath, option['domain'], option['verbose'])
       
   491             exit_code = 0
   491         except IOError, e:
   492         except IOError, e:
   492             printUsage(e[1] + '\n   You must write a file app.fil that contains the list of all files to parse.')
   493             printUsage(e[1] + '\n   You must write a file app.fil that contains the list of all files to parse.')
   493     if option['mo']:
   494     if option['mo']:
   494         makeMO(appDirPath, option['moTarget'], option['domain'], option['verbose'], option['forceEnglish'])
   495         makeMO(appDirPath, option['moTarget'], option['domain'], option['verbose'], option['forceEnglish'])
   495     sys.exit(1)
   496         exit_code = 0
   496 
   497     sys.exit(exit_code)
   497 
   498 
   498 # -----------------------------------------------------------------------------
   499 
       
   500 # -----------------------------------------------------------------------------