parameters: (self, repo_abspath, repo_file_paths)
return_statement: return exclude_patterns
docstring: Returns exclude patterns for a given repo. It looks for .gitattributes files in repo_file_paths.
  
          Resulting dictionary will contain exclude patterns per path (relative to the repo_abspath).
          E.g. {('.', 'Catalyst', 'Editions', 'Base'), ['Foo*', '*Bar']}
  
          @type repo_abspath:     string
          @param repo_abspath:    Absolute path to the git repository.
  
          @type repo_file_paths:  list
          @param repo_file_paths: List of paths relative to the repo_abspath that are under git control.
  
          @rtype:         dict
          @return:    Dictionary representing exclude patterns.
                      Keys are tuples of strings. Values are lists of strings.
                      Returns None if self.exclude is not set.
docstring_summary: Returns exclude patterns for a given repo. It looks for .gitattributes files in repo_file_paths.
docstring_tokens: Returns exclude patterns for a given repo . It looks for . gitattributes files in repo_file_paths .
function: def get_exclude_patterns(self, repo_abspath, repo_file_paths):
          """
          Returns exclude patterns for a given repo. It looks for .gitattributes files in repo_file_paths.
  
          Resulting dictionary will contain exclude patterns per path (relative to the repo_abspath).
          E.g. {('.', 'Catalyst', 'Editions', 'Base'), ['Foo*', '*Bar']}
  
          @type repo_abspath:     string
          @param repo_abspath:    Absolute path to the git repository.
  
          @type repo_file_paths:  list
          @param repo_file_paths: List of paths relative to the repo_abspath that are under git control.
  
          @rtype:         dict
          @return:    Dictionary representing exclude patterns.
                      Keys are tuples of strings. Values are lists of strings.
                      Returns None if self.exclude is not set.
          """
          if not self.exclude:
              return None
  
          def read_attributes(attributes_abspath):
              patterns = []
              if path.isfile(attributes_abspath):
                  attributes = open(attributes_abspath, 'r').readlines()
                  patterns = []
                  for line in attributes:
                      tokens = line.strip().split()
                      if "export-ignore" in tokens[1:]:
                          patterns.append(tokens[0])
              return patterns
  
          exclude_patterns = {(): []}
  
          # There may be no gitattributes.
          try:
              global_attributes_abspath = self.read_shell("git config --get core.attributesfile", repo_abspath).rstrip()
              exclude_patterns[()] = read_attributes(global_attributes_abspath)
          except Exception:
              # And valid to not have them.
              pass
  
          for attributes_abspath in [path.join(repo_abspath, f) for f in repo_file_paths if f.endswith(".gitattributes")]:
              # Each .gitattributes affects only files within its directory.
              key = tuple(self.get_path_components(repo_abspath, path.dirname(attributes_abspath)))
              exclude_patterns[key] = read_attributes(attributes_abspath)
  
          local_attributes_abspath = path.join(repo_abspath, ".git", "info", "attributes")
          key = tuple(self.get_path_components(repo_abspath, repo_abspath))
  
          if key in exclude_patterns:
              exclude_patterns[key].extend(read_attributes(local_attributes_abspath))
          else:
              exclude_patterns[key] = read_attributes(local_attributes_abspath)
  
          return exclude_patterns
function_tokens: def get_exclude_patterns ( self , repo_abspath , repo_file_paths ) : if not self . exclude : return None def read_attributes ( attributes_abspath ) : patterns = [ ] if path . isfile ( attributes_abspath ) : attributes = open ( attributes_abspath , 'r' ) . readlines ( ) patterns = [ ] for line in attributes : tokens = line . strip ( ) . split ( ) if "export-ignore" in tokens [ 1 : ] : patterns . append ( tokens [ 0 ] ) return patterns exclude_patterns = { ( ) : [ ] } # There may be no gitattributes. try : global_attributes_abspath = self . read_shell ( "git config --get core.attributesfile" , repo_abspath ) . rstrip ( ) exclude_patterns [ ( ) ] = read_attributes ( global_attributes_abspath ) except Exception : # And valid to not have them. pass for attributes_abspath in [ path . join ( repo_abspath , f ) for f in repo_file_paths if f . endswith ( ".gitattributes" ) ] : # Each .gitattributes affects only files within its directory. key = tuple ( self . get_path_components ( repo_abspath , path . dirname ( attributes_abspath ) ) ) exclude_patterns [ key ] = read_attributes ( attributes_abspath ) local_attributes_abspath = path . join ( repo_abspath , ".git" , "info" , "attributes" ) key = tuple ( self . get_path_components ( repo_abspath , repo_abspath ) ) if key in exclude_patterns : exclude_patterns [ key ] . extend ( read_attributes ( local_attributes_abspath ) ) else : exclude_patterns [ key ] = read_attributes ( local_attributes_abspath ) return exclude_patterns