Back to index

plone3  3.1.7
Functions | Variables
sync Namespace Reference

Functions

def main

Variables

tuple __I18NDUDE = os.environ.get('I18NDUDE', 'i18ndude')

Detailed Description

   Usage: sync.py [<product> | <language-code>]

Function Documentation

def sync.main ( )

Definition at line 10 of file sync.py.

00010 
00011 def main():
00012     if len(sys.argv) == 1:
00013         print 'You have to specify a product or a language code.'
00014         sys.exit(1)
00015 
00016     product = getLongProductName(sys.argv[1])
00017     pot = '%s.pot' % product
00018 
00019     os.chdir('..')
00020     os.chdir('i18n')
00021 
00022     if not os.path.isfile(pot): # no pot? test for language-code
00023         poFiles = getPoFilesByLanguageCode(product)
00024         if poFiles:
00025             potFiles = getPotFiles()
00026             for po in poFiles:
00027                 for pot in potFiles:
00028                     if getProduct(po) == getProduct(pot):
00029                         os.system(__I18NDUDE + (' sync --pot %s %s') % (pot, po))
00030         else:
00031             print 'Neither a pot nor po files for the given argument were found.'
00032             sys.exit(3)
00033 
00034     else: # product was given
00035         poFiles = getPoFilesAsCmdLine(product)
00036         if poFiles == []:
00037             print 'No po-files were found for the given product.'
00038             sys.exit(4)
00039 
00040         os.system(__I18NDUDE + (' sync --pot %s %s') % (pot, poFiles))

Here is the call graph for this function:


Variable Documentation

tuple sync.__I18NDUDE = os.environ.get('I18NDUDE', 'i18ndude')

Definition at line 8 of file sync.py.