def translation_project_dir_exists(language, project):
 if (project.get_treestyle() == 'gnu'):
  if (language.code == 'templates'):
   for (dirpath_, dirnames, filenames) in os.walk(project.get_real_path()):
    for filename in filenames:
     if (project.file_belongs_to_project(filename, match_templates=True) and match_template_filename(project, filename)):
      return True
  else:
   for (dirpath_, dirnames, filenames) in os.walk(project.get_real_path()):
    for filename in filenames:
     filename_matches = (project.file_belongs_to_project(filename, match_templates=False) and direct_language_match_filename(project.lang_mapper.get_upstream_code(language.code), filename))
     if filename_matches:
      return True
 else:
  try:
   (dirpath_, dirnames, filename) = os.walk(project.get_real_path()).next()
   lang_code = project.lang_mapper.get_upstream_code(language.code)
   if (lang_code in dirnames):
    return True
  except StopIteration:
   pass
 return False

def translation_project_dir_exists ( language , project ) : if ( project . get_treestyle ( ) == 'gnu' ) : if ( language . code == 'templates' ) : for ( dirpath_ , dirnames , filenames ) in os . walk ( project . get_real_path ( ) ) : for filename in filenames : if ( project . file_belongs_to_project ( filename , match_templates = True ) and match_template_filename ( project , filename ) ) : return True else : for ( dirpath_ , dirnames , filenames ) in os . walk ( project . get_real_path ( ) ) : for filename in filenames : filename_matches = ( project . file_belongs_to_project ( filename , match_templates = False ) and direct_language_match_filename ( project . lang_mapper . get_upstream_code ( language . code ) , filename ) ) if filename_matches : return True else : try : ( dirpath_ , dirnames , filename ) = os . walk ( project . get_real_path ( ) ) . next ( ) lang_code = project . lang_mapper . get_upstream_code ( language . code ) if ( lang_code in dirnames ) : return True except StopIteration : pass return False
tests if there are translation files corresponding to the given .