parameters: (dcftree)
docstring: Print the Datacenter Folder Tree
docstring_summary: Print the Datacenter Folder Tree
docstring_tokens: Print the Datacenter Folder Tree
function: def print_dcftree(dcftree):
      """
      Print the Datacenter Folder Tree
      """
      for dc in dcftree:
          dcftree_by_folder = defaultdict(dict)
          for vm_path in dcftree[dc]:
              dcftree_by_folder[os.path.dirname(vm_path)][
                  os.path.basename(vm_path)
              ] = dcftree[dc][vm_path].config.instanceUuid
          print("DataCenter: %s" % dc)
          print(
              "%-36s %-50s %s"
              % (
                  "VM-Instance-UUID",
                  "VM-Name",
                  "VM-Folder and/or vApp",
              )
          )
          for vm_folder in sorted(dcftree_by_folder):
              for vm_name in sorted(dcftree_by_folder[vm_folder]):
                  print(
                      "%36s %-50s %s"
                      % (
                          dcftree_by_folder[vm_folder][vm_name],
                          vm_name,
                          vm_folder,
                      )
                  )
function_tokens: def print_dcftree ( dcftree ) : for dc in dcftree : dcftree_by_folder = defaultdict ( dict ) for vm_path in dcftree [ dc ] : dcftree_by_folder [ os . path . dirname ( vm_path ) ] [ os . path . basename ( vm_path ) ] = dcftree [ dc ] [ vm_path ] . config . instanceUuid print ( "DataCenter: %s" % dc ) print ( "%-36s %-50s %s" % ( "VM-Instance-UUID" , "VM-Name" , "VM-Folder and/or vApp" , ) ) for vm_folder in sorted ( dcftree_by_folder ) : for vm_name in sorted ( dcftree_by_folder [ vm_folder ] ) : print ( "%36s %-50s %s" % ( dcftree_by_folder [ vm_folder ] [ vm_name ] , vm_name , vm_folder , ) )