def fetch(resources=None, languages=None):
 locale_dirs = _get_locale_dirs(resources)
 errors = []
 for (name, dir_) in locale_dirs:
  if (languages is None):
   call('tx pull -r {res} -f  --minimum-perc=5'.format(res=_tx_resource_for_name(name)), shell=True)
   languages = sorted([d for d in os.listdir(dir_) if ((not d.startswith('_')) and os.path.isdir(os.path.join(dir_, d)) and (d != 'en'))])
  else:
   for lang in languages:
    call('tx pull -r {res} -f -l {lang}'.format(res=_tx_resource_for_name(name), lang=lang), shell=True)
  for lang in languages:
   po_path = '{path}/{lang}/LC_MESSAGES/django.po'.format(path=dir_, lang=lang)
   if (not os.path.exists(po_path)):
    print 'No {lang} translation for resource {res}'.format(lang=lang, res=name)
    continue
   call('msgcat -o {0} {0}'.format(po_path), shell=True)
   res = call('msgfmt -c -o {0}.mo {1}'.format(po_path[:(-3)], po_path), shell=True)
   if (res != 0):
    errors.append((name, lang))
 if errors:
  print '\nWARNING: Errors have occurred in following cases:'
  for (resource, lang) in errors:
   print ' DCTB Resource {res} for language {lang}'.format(res=resource, lang=lang)
  exit(1)

def fetch ( resources = None , languages = None ) : locale_dirs = _get_locale_dirs ( resources ) errors = [ ] for ( name , dir_ ) in locale_dirs : if ( languages is None ) : call ( 'tx pull -r {res} -f  --minimum-perc=5' . format ( res = _tx_resource_for_name ( name ) ) , shell = True ) languages = sorted ( [ d for d in os . listdir ( dir_ ) if ( ( not d . startswith ( '_' ) ) and os . path . isdir ( os . path . join ( dir_ , d ) ) and ( d != 'en' ) ) ] ) else : for lang in languages : call ( 'tx pull -r {res} -f -l {lang}' . format ( res = _tx_resource_for_name ( name ) , lang = lang ) , shell = True ) for lang in languages : po_path = '{path}/{lang}/LC_MESSAGES/django.po' . format ( path = dir_ , lang = lang ) if ( not os . path . exists ( po_path ) ) : print 'No {lang} translation for resource {res}' . format ( lang = lang , res = name ) continue call ( 'msgcat -o {0} {0}' . format ( po_path ) , shell = True ) res = call ( 'msgfmt -c -o {0}.mo {1}' . format ( po_path [ : ( - 3 ) ] , po_path ) , shell = True ) if ( res != 0 ) : errors . append ( ( name , lang ) ) if errors : print '\nWARNING: Errors have occurred in following cases:' for ( resource , lang ) in errors : print ' DCTB Resource {res} for language {lang}' . format ( res = resource , lang = lang ) exit ( 1 )
fetches remote packages cli example: .