コード例 #1
0
ファイル: sync.py プロジェクト: MWatHIT/System
def main():
    if len(sys.argv) == 1:
        print 'You have to specify a product or a language code.'
        sys.exit(1)

    product = getLongProductName(sys.argv[1])
    pot = '%s.pot' % product

    os.chdir('..')
    os.chdir('i18n')

    if not os.path.isfile(pot):  # no pot? test for language-code
        poFiles = getPoFilesByLanguageCode(product)
        if poFiles:
            potFiles = getPotFiles()
            for po in poFiles:
                for pot in potFiles:
                    if getProduct(po) == getProduct(pot):
                        os.system(__I18NDUDE + (' sync --pot %s %s') %
                                  (pot, po))
        else:
            print 'Neither a pot nor po files for the given argument were found.'
            sys.exit(3)

    else:  # product was given
        poFiles = getPoFilesAsCmdLine(product)
        if poFiles == []:
            print 'No po-files were found for the given product.'
            sys.exit(4)

        os.system(__I18NDUDE + (' sync --pot %s %s') % (pot, poFiles))
コード例 #2
0
ファイル: sync.py プロジェクト: erral/plone.app.locales
def main():
    if len(sys.argv) == 1:
        print 'You have to specify a product or a language code.'
        sys.exit(1)

    product = getLongProductName(sys.argv[1])
    pot = '%s.pot' % product

    os.chdir('..')
    os.chdir('i18n')

    if not os.path.isfile(pot): # no pot? test for language-code
        poFiles = getPoFilesByLanguageCode(product)
        if poFiles:
            potFiles = getPotFiles()
            for po in poFiles:
                for pot in potFiles:
                    if getProduct(po) == getProduct(pot):
                        os.system(__I18NDUDE + (' sync --pot %s %s') % (pot, po))
        else:
            print 'Neither a pot nor po files for the given argument were found.'
            sys.exit(3)

    else: # product was given
        poFiles = getPoFilesAsCmdLine(product)
        if poFiles == []:
            print 'No po-files were found for the given product.'
            sys.exit(4)

        os.system(__I18NDUDE + (' sync --pot %s %s') % (pot, poFiles))
コード例 #3
0
def main():
    if len(sys.argv) == 1:
        print 'You have to specify the product.'
        sys.exit(1)

    product = getLongProductName(sys.argv[1])
    pot = '%s.pot' % product
    chart = os.curdir + os.sep + 'charts' + os.sep + '%s-chart.gif' % product

    os.chdir('..')

    if not os.path.isfile(pot):
        print 'No pot was found for the given product.'
        sys.exit(2)

    poFiles = getPoFilesAsCmdLine(product)
    if poFiles == '':
        print 'No po-files were found for the given product.'
        sys.exit(3)

    os.system(__PYTHON + ' ' + __I18NDUDE + (' chart -o %s --pot %s %s') % (chart, pot, poFiles))
コード例 #4
0
def main():
    if len(sys.argv) == 1:
        print 'You have to specify the product.'
        sys.exit(1)

    product = getLongProductName(sys.argv[1])
    pot = '%s.pot' % product
    chart = os.curdir + os.sep + 'charts' + os.sep + '%s-chart.gif' % product

    os.chdir('..')

    if not os.path.isfile(pot):
        print 'No pot was found for the given product.'
        sys.exit(2)

    poFiles = getPoFilesAsCmdLine(product)
    if poFiles == '':
        print 'No po-files were found for the given product.'
        sys.exit(3)

    os.system(__PYTHON + ' ' + __I18NDUDE + (' chart -o %s --pot %s %s') %
              (chart, pot, poFiles))