def generate_sub_moved_events(src_dir_path, dest_dir_path):
 for (root, directories, filenames) in os.walk(dest_dir_path):
  for directory in directories:
   full_path = os.path.join(root, directory)
   renamed_path = (full_path.replace(dest_dir_path, src_dir_path) if src_dir_path else None)
   (yield DirMovedEvent(renamed_path, full_path))
  for filename in filenames:
   full_path = os.path.join(root, filename)
   renamed_path = (full_path.replace(dest_dir_path, src_dir_path) if src_dir_path else None)
   (yield FileMovedEvent(renamed_path, full_path))

def generate_sub_moved_events ( src_dir_path , dest_dir_path ) : for ( root , directories , filenames ) in os . walk ( dest_dir_path ) : for directory in directories : full_path = os . path . join ( root , directory ) renamed_path = ( full_path . replace ( dest_dir_path , src_dir_path ) if src_dir_path else None ) ( yield DirMovedEvent ( renamed_path , full_path ) ) for filename in filenames : full_path = os . path . join ( root , filename ) renamed_path = ( full_path . replace ( dest_dir_path , src_dir_path ) if src_dir_path else None ) ( yield FileMovedEvent ( renamed_path , full_path ) )
generates an event list of :class:dirmovedevent and :class:filemovedevent objects for all the files and directories within the given moved directory that were moved along with the directory .