parameters: (obj, path="", prefix="", max_entries=INF)
docstring: Obj is a filesystem-like object; path must be a string.
  
      Recursively descends into subdirectories using prefix.
  
      If max_entries is given, only that number of entries per directory
      is printed.
docstring_summary: Obj is a filesystem-like object; path must be a string.
docstring_tokens: Obj is a filesystem - like object ; path must be a string .
function: def print_tree(obj, path="", prefix="", max_entries=INF):
      """
      Obj is a filesystem-like object; path must be a string.
  
      Recursively descends into subdirectories using prefix.
  
      If max_entries is given, only that number of entries per directory
      is printed.
      """
      # entries is a list of tuples of entryname, isdir, ismeta
      entries = []
      for entry in obj.listdirs(path):
          entries.append((entry, True, False))
      for entry in obj.listfiles(path):
          entries.append((entry, False, False))
  
      if not entries:
          entries.append(("[empty]", False, True))
  
      if len(entries) > max_entries:
          omit = len(entries) - max_entries + 1
          entries = entries[:-omit] + [("[%d omitted]" % omit, False, True)]
  
      from .iterators import denote_last
      for (name, isdir, is_meta), is_last in denote_last(entries):
          if is_last:
              treesymbol, nextindent = '\u2514', '   '
          else:
              treesymbol, nextindent = '\u251c', '\u2502  '
  
          if is_meta:
              entryindent = '\u257c '
          else:
              entryindent = '\u2500 '
  
          if isdir:
              print(prefix + treesymbol + entryindent + colorize_dirname(name))
              obj.print_tree(path + '/' + name, prefix + nextindent, max_entries)
              print(prefix + nextindent)
          else:
              print(prefix + treesymbol + entryindent + colorize_filename(name))
function_tokens: def print_tree ( obj , path = "" , prefix = "" , max_entries = INF ) : # entries is a list of tuples of entryname, isdir, ismeta entries = [ ] for entry in obj . listdirs ( path ) : entries . append ( ( entry , True , False ) ) for entry in obj . listfiles ( path ) : entries . append ( ( entry , False , False ) ) if not entries : entries . append ( ( "[empty]" , False , True ) ) if len ( entries ) > max_entries : omit = len ( entries ) - max_entries + 1 entries = entries [ : - omit ] + [ ( "[%d omitted]" % omit , False , True ) ] from . iterators import denote_last for ( name , isdir , is_meta ) , is_last in denote_last ( entries ) : if is_last : treesymbol , nextindent = '\u2514' , '   ' else : treesymbol , nextindent = '\u251c' , '\u2502  ' if is_meta : entryindent = '\u257c ' else : entryindent = '\u2500 ' if isdir : print ( prefix + treesymbol + entryindent + colorize_dirname ( name ) ) obj . print_tree ( path + '/' + name , prefix + nextindent , max_entries ) print ( prefix + nextindent ) else : print ( prefix + treesymbol + entryindent + colorize_filename ( name ) )