def process_po_folder(domain, folder, extra=''):
 result = True
 for fname in glob.glob(os.path.join(folder, '*.po')):
  basename = os.path.split(fname)[1]
  name = os.path.splitext(basename)[0]
  mo_path = os.path.normpath(('%s/%s%s' % (MO_DIR, name, MO_LOCALE)))
  mo_name = ('%s.mo' % domain)
  if (not os.path.exists(mo_path)):
   os.makedirs(mo_path)
  mo_file = os.path.join(mo_path, mo_name)
  print ('Compile %s' % mo_file)
  (ret, output) = run(('%s %s -o "%s" "%s"' % (TOOL, extra, mo_file, fname)))
  if (ret != 0):
   print ('\nMissing %s. Please install this package first.' % TOOL)
   exit(1)
  if ('WARNING:' in output):
   print output
   result = False
 return result

def process_po_folder ( domain , folder , extra = '' ) : result = True for fname in glob . glob ( os . path . join ( folder , '*.po' ) ) : basename = os . path . split ( fname ) [ 1 ] name = os . path . splitext ( basename ) [ 0 ] mo_path = os . path . normpath ( ( '%s/%s%s' % ( MO_DIR , name , MO_LOCALE ) ) ) mo_name = ( '%s.mo' % domain ) if ( not os . path . exists ( mo_path ) ) : os . makedirs ( mo_path ) mo_file = os . path . join ( mo_path , mo_name ) print ( 'Compile %s' % mo_file ) ( ret , output ) = run ( ( '%s %s -o "%s" "%s"' % ( TOOL , extra , mo_file , fname ) ) ) if ( ret != 0 ) : print ( '\nMissing %s. Please install this package first.' % TOOL ) exit ( 1 ) if ( 'WARNING:' in output ) : print output result = False return result
process each po file in folder .