wxPython/wxGlade-0.9.1/install/update-po.py
def makePO(applicationDirectoryPath,  applicationDomain=None, verbose=0) :
    """Build the Portable Object Template file for the application.

    makePO builds the .pot file for the application stored inside 
    a specified directory by running xgettext for all application source 
    files.  It finds the name of all files by looking for a file called 'app.fil'. 
    If this file does not exists, makePo raises an IOError exception.
    By default the application domain (the application
    name) is the same as the directory name but it can be overridden by the
    'applicationDomain' argument.

    makePO always creates a new file called messages.pot.  If it finds files 
    of the form app_xx.po where 'app' is the application name and 'xx' is one 
    of the ISO 639 two-letter language codes, makePO resynchronizes those 
    files with the latest extracted strings (now contained in messages.pot). 
    This process updates all line location number in the language-specific
    .po files and may also create new entries for translation (or comment out 
    some).  The .po file is not changed, instead a new file is created with 
    the .new extension appended to the name of the .po file.

    By default the function does not display what it is doing.  Set the 
    verbose argument to 1 to force it to print its commands.
    """

    if applicationDomain is None:
        applicationName = fileBaseOf(applicationDirectoryPath,withPath=0)
    else:
        applicationName = applicationDomain
    currentDir = os.getcwd()
    os.chdir(applicationDirectoryPath)
    if not os.path.exists('app.fil'):
        raise IOError(2,'No module file: app.fil')

    # Steps:
    #  Use xgettext to parse all application modules
    #  The following switches are used:
    #
    #   -s                          : sort output by string content (easier to use when we need to merge several .po files)
    #   --files-from=app.fil        : The list of files is taken from the file: app.fil
    #   --output=                   : specifies the name of the output file (using a .pot extension)
    cmd = 'xgettext -s --no-wrap --files-from=app.fil --output=messages.pot'
    if verbose: print cmd
    os.system(cmd)

    languageDict = getlanguageDict()

    for langCode in languageDict.keys():
        if langCode == 'en':
            pass
        else:
            langPOfileName = "%s_%s.po" % (applicationName , langCode)
            if os.path.exists(langPOfileName):
                cmd = 'msgmerge -s --no-wrap "%s" messages.pot > "%s.new"' % (langPOfileName, langPOfileName)
                if verbose: print cmd
                os.system(cmd)
    os.chdir(currentDir)
Build the Portable Object Template file for the application.

    makePO builds the .pot file for the application stored inside 
    a specified directory by running xgettext for all application source 
    files.  It finds the name of all files by looking for a file called 'app.fil'. 
    If this file does not exists, makePo raises an IOError exception.
    By default the application domain (the application
    name) is the same as the directory name but it can be overridden by the
    'applicationDomain' argument.

    makePO always creates a new file called messages.pot.  If it finds files 
    of the form app_xx.po where 'app' is the application name and 'xx' is one 
    of the ISO 639 two-letter language codes, makePO resynchronizes those 
    files with the latest extracted strings (now contained in messages.pot). 
    This process updates all line location number in the language-specific
    .po files and may also create new entries for translation (or comment out 
    some).  The .po file is not changed, instead a new file is created with 
    the .new extension appended to the name of the .po file.

    By default the function does not display what it is doing.  Set the 
    verbose argument to 1 to force it to print its commands.
    
Build the Portable Object Template file for the application.
makePO builds the .pot file for the application stored inside
a specified directory by running xgettext for all application source
files.  It finds the name of all files by looking for a file called 'app.fil'.
If this file does not exists, makePo raises an IOError exception.
By default the application domain (the application
name) is the same as the directory name but it can be overridden by the
'applicationDomain' argument.

makePO always creates a new file called messages.pot.  If it finds files
of the form app_xx.po where 'app' is the application name and 'xx' is one
of the ISO 639 two-letter language codes, makePO resynchronizes those
files with the latest extracted strings (now contained in messages.pot).
This process updates all line location number in the language-specific
.po files and may also create new entries for translation (or comment out
some).  The .po file is not changed, instead a new file is created with
the .new extension appended to the name of the .po file.

By default the function does not display what it is doing.  Set the
verbose argument to 1 to force it to print its commands.
Build the Portable Object Template file for the application . makePO builds the . pot file for the application stored inside a specified directory by running xgettext for all application source files . It finds the name of all files by looking for a file called ' app . fil ' . If this file does not exists makePo raises an IOError exception . By default the application domain ( the application name ) is the same as the directory name but it can be overridden by the ' applicationDomain ' argument . makePO always creates a new file called messages . pot . If it finds files of the form app_xx . po where ' app ' is the application name and ' xx ' is one of the ISO 639 two - letter language codes makePO resynchronizes those files with the latest extracted strings ( now contained in messages . pot ) . This process updates all line location number in the language - specific . po files and may also create new entries for translation ( or comment out some ) . The . po file is not changed instead a new file is created with the . new extension appended to the name of the . po file . By default the function does not display what it is doing . Set the verbose argument to 1 to force it to print its commands .
def makePO(applicationDirectoryPath,  applicationDomain=None, verbose=0) :
    if applicationDomain is None:
        applicationName = fileBaseOf(applicationDirectoryPath,withPath=0)
    else:
        applicationName = applicationDomain
    currentDir = os.getcwd()
    os.chdir(applicationDirectoryPath)
    if not os.path.exists('app.fil'):
        raise IOError(2,'No module file: app.fil')
       -s                          : sort output by string content (easier to use when we need to merge several .po files)
       --files-from=app.fil        : The list of files is taken from the file: app.fil
       --output=                   : specifies the name of the output file (using a .pot extension)
    cmd = 'xgettext -s --no-wrap --files-from=app.fil --output=messages.pot'
    if verbose: print cmd
    os.system(cmd)
    languageDict = getlanguageDict()
    for langCode in languageDict.keys():
        if langCode == 'en':
            pass
        else:
            langPOfileName = "%s_%s.po" % (applicationName , langCode)
            if os.path.exists(langPOfileName):
                cmd = 'msgmerge -s --no-wrap "%s" messages.pot > "%s.new"' % (langPOfileName, langPOfileName)
                if verbose: print cmd
                os.system(cmd)
    os.chdir(currentDir)
def makePO ( applicationDirectoryPath , applicationDomain = None , verbose = 0 ) : if applicationDomain is None : applicationName = fileBaseOf ( applicationDirectoryPath , withPath = 0 ) else : applicationName = applicationDomain currentDir = os . getcwd ( ) os . chdir ( applicationDirectoryPath ) if not os . path . exists ( 'app.fil' ) : raise IOError ( 2 , 'No module file: app.fil' ) cmd = 'xgettext -s --no-wrap --files-from=app.fil --output=messages.pot' if verbose : print cmd os . system ( cmd ) languageDict = getlanguageDict ( ) for langCode in languageDict . keys ( ) : if langCode == 'en' : pass else : langPOfileName = "%s_%s.po" % ( applicationName , langCode ) if os . path . exists ( langPOfileName ) : cmd = 'msgmerge -s --no-wrap "%s" messages.pot > "%s.new"' % ( langPOfileName , langPOfileName ) if verbose : print cmd os . system ( cmd ) os . chdir ( currentDir )
Build the Portable Object Template file for the application.
Build the Portable Object Template file for the application .
"""Build the Portable Object Template file for the application.

    makePO builds the .pot file for the application stored inside 
    a specified directory by running xgettext for all application source 
    files.  It finds the name of all files by looking for a file called 'app.fil'. 
    If this file does not exists, makePo raises an IOError exception.
    By default the application domain (the application
    name) is the same as the directory name but it can be overridden by the
    'applicationDomain' argument.

    makePO always creates a new file called messages.pot.  If it finds files 
    of the form app_xx.po where 'app' is the application name and 'xx' is one 
    of the ISO 639 two-letter language codes, makePO resynchronizes those 
    files with the latest extracted strings (now contained in messages.pot). 
    This process updates all line location number in the language-specific
    .po files and may also create new entries for translation (or comment out 
    some).  The .po file is not changed, instead a new file is created with 
    the .new extension appended to the name of the .po file.

    By default the function does not display what it is doing.  Set the 
    verbose argument to 1 to force it to print its commands.
    """ # Steps: #  Use xgettext to parse all application modules #  The following switches are used: # #   -s                          : sort output by string content (easier to use when we need to merge several .po files) #   --files-from=app.fil        : The list of files is taken from the file: app.fil #   --output=                   : specifies the name of the output file (using a .pot extension)
applicationDirectoryPath
applicationDomain
verbose