Lines Matching defs:ResultInfo
17 """Exception to raise when error occurs in ResultInfo collection."""
20 class ResultInfo(dict):
27 files: A list of ResultInfo for the files and sub-directories of the result.
33 starts, ResultInfo for this file shall be:
36 bytes, the new ResultInfo will be:
47 150 bytes, thus the final ResultInfo of the file becomes:
60 dictionary. For example, an instance of ResultInfo can have following
91 A ResultInfo object can be initialized in two ways:
101 @param parent_result_info: A ResultInfo object for the parent directory.
111 super(ResultInfo, self).__init__()
155 # The value of key utils_lib.DIRS is a list of ResultInfo objects.
197 # The value of key utils_lib.DIRS is a list of ResultInfo objects.
200 # This is restoring ResultInfo from a json string.
243 """Get the ResultInfo for the given path.
247 @param parent_result_info: A ResultInfo instance for the parent
249 @param top_dir: The top directory to collect ResultInfo. This is to
255 @return: A ResultInfo instance containing the directory summary.
262 # the ResultInfo is for a single file with root directory of the default
266 dir_info = ResultInfo(parent_dir=root_dir,
271 dir_info = ResultInfo(parent_dir=parent_dir,
290 dir_info.files.append(ResultInfo.build_from_path(
333 @return: A list of ResultInfo objects.
439 ResultInfo(parent_dir=self._path,
443 # After a new ResultInfo is added, update the sizes if the object is
454 # After a new ResultInfo is removed, update the sizes if the object is
468 @return: A ResultInfo object of the file.
570 It's used when a ResultInfo object is moved to a different file
573 @param parent_result_info: A ResultInfo object for the parent directory.
583 """Merge a ResultInfo instance to the current one.
585 Update the old directory's ResultInfo with the new one. Also calculate
587 difference between the two ResultInfo.
590 the new ResultInfo or files with size different from the newer files
608 rsync-ed to the drone. Therefore, the merged ResultInfo will be:
620 The only exception is that the new ResultInfo's ORIGINAL_SIZE_BYTES is
621 the same as the current ResultInfo's TRIMMED_SIZE_BYTES. That means the
622 file was trimmed in the current ResultInfo and the new ResultInfo is
624 data in the current ResultInfo.
626 @param new_info: New ResultInfo to be merged into the current one.
646 # `name` is a directory in the new ResultInfo, try to merge it
647 # with the current ResultInfo.
651 # If `name` is a file in the current ResultInfo but a
652 # directory in new ResultInfo, the file in the current
653 # ResultInfo will be overwritten by the new directory by
655 # the current ResultInfo, so that the new directory can be
663 # If `name` is a directory in the current ResultInfo, but a file
664 # in the new ResultInfo, rsync will fail to copy the file as it
681 # ResultInfo. That means the file was trimmed earlier and stays
688 # ResultInfo, it's not considered to be trimmed if the size is
721 # An empty directory, used to compare with a ResultInfo.
722 EMPTY = ResultInfo(parent_dir='',
730 @param summary: A ResultInfo object for a result directory.
741 @return: A ResultInfo object containing the directory summary.
746 # Convert summary to ResultInfo objects
748 return ResultInfo(parent_dir=result_dir, original_info=summary)