original_docstring: 
          Get a list of directories for the target environment using dulwich
          
docstring: Get a list of directories for the target environment using dulwich
docstring_tokens: Get a list of directories for the target environment using dulwich
code: def dir_list(self, tgt_env):
          '''
          Get a list of directories for the target environment using dulwich
          '''
          def _traverse(tree, blobs, prefix):
              '''
              Traverse through a dulwich Tree object recursively, accumulating
              all the empty directories within it in the "blobs" list
              '''
              for item in six.iteritems(tree):
                  try:
                      obj = self.repo.get_object(item.sha)
                  except KeyError:
                      # Entry is a submodule, skip it
                      continue
                  if not isinstance(obj, dulwich.objects.Tree):
                      continue
                  blobs.append(salt.utils.path_join(prefix, item.path))
                  if len(self.repo.get_object(item.sha)):
                      _traverse(obj, blobs, salt.utils.path_join(prefix, item.path))
  
          ret = set()
          tree = self.get_tree(tgt_env)
          tree = self.walk_tree(tree, self.root(tgt_env))
          if not isinstance(tree, dulwich.objects.Tree):
              return ret
          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 blob in blobs:
              ret.add(add_mountpoint(relpath(blob)))
          if self.mountpoint(tgt_env):
              ret.add(self.mountpoint(tgt_env))
          return ret
code_tokens: def dir_list ( self , tgt_env ) : def _traverse ( tree , blobs , prefix ) : '''
              Traverse through a dulwich Tree object recursively, accumulating
              all the empty directories within it in the "blobs" list
              ''' for item in six . iteritems ( tree ) : try : obj = self . repo . get_object ( item . sha ) except KeyError : continue if not isinstance ( obj , dulwich . objects . Tree ) : continue blobs . append ( salt . utils . path_join ( prefix , item . path ) ) if len ( self . repo . get_object ( item . sha ) ) : _traverse ( obj , blobs , salt . utils . path_join ( prefix , item . path ) ) ret = set ( ) tree = self . get_tree ( tgt_env ) tree = self . walk_tree ( tree , self . root ( tgt_env ) ) if not isinstance ( tree , dulwich . objects . Tree ) : return ret 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 blob in blobs : ret . add ( add_mountpoint ( relpath ( blob ) ) ) if self . mountpoint ( tgt_env ) : ret . add ( self . mountpoint ( tgt_env ) ) return ret
short_docstring: Get a list of directories for the target environment using dulwich
short_docstring_tokens: Get a list of directories for the target environment using dulwich
comment: '''
          Get a list of directories for the target environment using dulwich
          '''$SEP$'''
              Traverse through a dulwich Tree object recursively, accumulating
              all the empty directories within it in the "blobs" list
              '''$SEP$# Entry is a submodule, skip it