Back to index

plone3  3.1.7
Functions | Variables
admix Namespace Reference

Functions

def main

Variables

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

Detailed Description

   Usage: admix.py <target-product> <source-product>

Function Documentation

def admix.main ( )

Definition at line 10 of file admix.py.

00010 
00011 def main():
00012     if len(sys.argv) < 3:
00013         print 'You have to specify the target and source product.'
00014         sys.exit(1)
00015 
00016     target = sys.argv[1]
00017     source = sys.argv[2]
00018 
00019     os.chdir('..')
00020     os.chdir('i18n')
00021 
00022     targetPoFiles = getPoFiles(target)
00023     sourcePoFiles = getPoFiles(source)
00024 
00025     if targetPoFiles == [] or sourcePoFiles == []:
00026         print 'No po-files were found for one of the given products.'
00027         sys.exit(3)
00028 
00029     for t in targetPoFiles:
00030         targetLanguage = getLanguage(target,t)
00031         for s in sourcePoFiles:
00032             sourceLanguage = getLanguage(source,s)
00033             if targetLanguage and sourceLanguage and targetLanguage == sourceLanguage:
00034                 print '%s %s <- %s' % (getLanguage(target, t), t, s)
00035                 os.system(__I18NDUDE + (' admix %s %s > %s-new') % (t, s, t))
00036                 targetpath = os.path.join(os.curdir, t)
00037                 os.remove(targetpath)
00038                 if not os.path.exists(targetpath):
00039                     shutil.copy(t+'-new', t)
00040                     os.remove(targetpath+'-new')

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

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

Definition at line 8 of file admix.py.