wxPython/wxGlade-0.9.1/install/update-po.py
def catPO(applicationDirectoryPath, listOf_extraPo, applicationDomain=None, targetDir=None, verbose=0) :
    """Concatenate one or several PO files with the application domain files.
    """

    if applicationDomain is None:
        applicationName = fileBaseOf(applicationDirectoryPath,withPath=0)
    else:
        applicationName = applicationDomain
    currentDir = os.getcwd()
    os.chdir(applicationDirectoryPath)

    languageDict = getlanguageDict()

    for langCode in languageDict.keys():
        if langCode == 'en':
            pass
        else:
            langPOfileName = "%s_%s.po" % (applicationName , langCode)
            if os.path.exists(langPOfileName):
                fileList = ''
                for fileName in listOf_extraPo:
                    fileList += ("%s_%s.po " % (fileName,langCode))
                cmd = "msgcat -s --no-wrap %s %s > %s.cat" % (langPOfileName, fileList, langPOfileName)
                if verbose: print cmd
                os.system(cmd)
                if targetDir is None:
                    pass
                else:
                    mo_targetDir = "%s/%s/LC_MESSAGES" % (targetDir,langCode)
                    cmd = "msgfmt --output-file=%s/%s.mo %s_%s.po.cat" % (mo_targetDir,applicationName,applicationName,langCode)
                    if verbose: print cmd
                    os.system(cmd)
    os.chdir(currentDir)
Concatenate one or several PO files with the application domain files.
    
Concatenate one or several PO files with the application domain files.
Concatenate one or several PO files with the application domain files .
def catPO(applicationDirectoryPath, listOf_extraPo, applicationDomain=None, targetDir=None, verbose=0) :
    if applicationDomain is None:
        applicationName = fileBaseOf(applicationDirectoryPath,withPath=0)
    else:
        applicationName = applicationDomain
    currentDir = os.getcwd()
    os.chdir(applicationDirectoryPath)
    languageDict = getlanguageDict()
    for langCode in languageDict.keys():
        if langCode == 'en':
            pass
        else:
            langPOfileName = "%s_%s.po" % (applicationName , langCode)
            if os.path.exists(langPOfileName):
                fileList = ''
                for fileName in listOf_extraPo:
                    fileList += ("%s_%s.po " % (fileName,langCode))
                cmd = "msgcat -s --no-wrap %s %s > %s.cat" % (langPOfileName, fileList, langPOfileName)
                if verbose: print cmd
                os.system(cmd)
                if targetDir is None:
                    pass
                else:
                    mo_targetDir = "%s/%s/LC_MESSAGES" % (targetDir,langCode)
                    cmd = "msgfmt --output-file=%s/%s.mo %s_%s.po.cat" % (mo_targetDir,applicationName,applicationName,langCode)
                    if verbose: print cmd
                    os.system(cmd)
    os.chdir(currentDir)
def catPO ( applicationDirectoryPath , listOf_extraPo , applicationDomain = None , targetDir = None , verbose = 0 ) : if applicationDomain is None : applicationName = fileBaseOf ( applicationDirectoryPath , withPath = 0 ) else : applicationName = applicationDomain currentDir = os . getcwd ( ) os . chdir ( applicationDirectoryPath ) languageDict = getlanguageDict ( ) for langCode in languageDict . keys ( ) : if langCode == 'en' : pass else : langPOfileName = "%s_%s.po" % ( applicationName , langCode ) if os . path . exists ( langPOfileName ) : fileList = '' for fileName in listOf_extraPo : fileList += ( "%s_%s.po " % ( fileName , langCode ) ) cmd = "msgcat -s --no-wrap %s %s > %s.cat" % ( langPOfileName , fileList , langPOfileName ) if verbose : print cmd os . system ( cmd ) if targetDir is None : pass else : mo_targetDir = "%s/%s/LC_MESSAGES" % ( targetDir , langCode ) cmd = "msgfmt --output-file=%s/%s.mo %s_%s.po.cat" % ( mo_targetDir , applicationName , applicationName , langCode ) if verbose : print cmd os . system ( cmd ) os . chdir ( currentDir )
Concatenate one or several PO files with the application domain files.
Concatenate one or several PO files with the application domain files .
"""Concatenate one or several PO files with the application domain files.
    """
applicationDirectoryPath
listOf_extraPo
applicationDomain
targetDir
verbose