original_docstring: 
          Get file list for the target environment using dulwich
          
docstring: Get file list for the target environment using dulwich
docstring_tokens: Get file list for the target environment using dulwich
code: def file_list(self, tgt_env):
          '''
          Get file list for the target environment using dulwich
          '''
          def _traverse(tree, blobs, prefix):
              '''
              Traverse through a dulwich Tree object recursively, accumulating
              all the file paths and symlinks info in the "blobs" dict
              '''
              for item in six.iteritems(tree):
                  try:
                      obj = self.repo.get_object(item.sha)
                  except KeyError:
                      # Entry is a submodule, skip it
                      continue
                  if isinstance(obj, dulwich.objects.Blob):
                      repo_path = salt.utils.path_join(prefix, item.path)
                      blobs.setdefault('files', []).append(repo_path)
                      mode, oid = tree[item.path]
                      if stat.S_ISLNK(mode):
                          link_tgt = self.repo.get_object(oid).as_raw_string()
                          blobs.setdefault('symlinks', {})[repo_path] = link_tgt
                  elif isinstance(obj, dulwich.objects.Tree):
                      _traverse(obj, blobs, salt.utils.path_join(prefix, item.path))
  
          files = set()
          symlinks = {}
          tree = self.get_tree(tgt_env)
          tree = self.walk_tree(tree, self.root(tgt_env))
          if not isinstance(tree, dulwich.objects.Tree):
              return files, symlinks
          blobs = {}
          if len(tree):
              _traverse(tree, blobs, self.root(tgt_env))
          if self.root(tgt_env):
              relpath = lambda path: os.path.relpath(path, self.root(tgt_env))
          else:
              relpath = lambda path: path
          add_mountpoint = lambda path: salt.utils.path_join(self.mountpoint(tgt_env), path)
          for repo_path in blobs.get('files', []):
              files.add(add_mountpoint(relpath(repo_path)))
          for repo_path, link_tgt in six.iteritems(blobs.get('symlinks', {})):
              symlinks[add_mountpoint(relpath(repo_path))] = link_tgt
          return files, symlinks
code_tokens: def file_list ( self , tgt_env ) : def _traverse ( tree , blobs , prefix ) : '''
              Traverse through a dulwich Tree object recursively, accumulating
              all the file paths and symlinks info in the "blobs" dict
              ''' for item in six . iteritems ( tree ) : try : obj = self . repo . get_object ( item . sha ) except KeyError : continue if isinstance ( obj , dulwich . objects . Blob ) : repo_path = salt . utils . path_join ( prefix , item . path ) blobs . setdefault ( 'files' , [ ] ) . append ( repo_path ) mode , oid = tree [ item . path ] if stat . S_ISLNK ( mode ) : link_tgt = self . repo . get_object ( oid ) . as_raw_string ( ) blobs . setdefault ( 'symlinks' , { } ) [ repo_path ] = link_tgt elif isinstance ( obj , dulwich . objects . Tree ) : _traverse ( obj , blobs , salt . utils . path_join ( prefix , item . path ) ) files = set ( ) symlinks = { } tree = self . get_tree ( tgt_env ) tree = self . walk_tree ( tree , self . root ( tgt_env ) ) if not isinstance ( tree , dulwich . objects . Tree ) : return files , symlinks blobs = { } if len ( tree ) : _traverse ( tree , blobs , self . root ( tgt_env ) ) if self . root ( tgt_env ) : relpath = lambda path : os . path . relpath ( path , self . root ( tgt_env ) ) else : relpath = lambda path : path add_mountpoint = lambda path : salt . utils . path_join ( self . mountpoint ( tgt_env ) , path ) for repo_path in blobs . get ( 'files' , [ ] ) : files . add ( add_mountpoint ( relpath ( repo_path ) ) ) for repo_path , link_tgt in six . iteritems ( blobs . get ( 'symlinks' , { } ) ) : symlinks [ add_mountpoint ( relpath ( repo_path ) ) ] = link_tgt return files , symlinks
short_docstring: Get file list for the target environment using dulwich
short_docstring_tokens: Get file list for the target environment using dulwich
comment: '''
          Get file list for the target environment using dulwich
          '''$SEP$'''
              Traverse through a dulwich Tree object recursively, accumulating
              all the file paths and symlinks info in the "blobs" dict
              '''$SEP$# Entry is a submodule, skip it