b2sdk._internal.scan.scan

b2sdk._internal.scan.scan.zip_folders(folder_a, folder_b, reporter, policies_manager=<b2sdk._internal.scan.policies.ScanPoliciesManager object>)[source]

Iterate over all of the files in the union of two folders, matching file names.

Each item is a pair (file_a, file_b) with the corresponding file in both folders. Either file (but not both) will be None if the file is in only one folder.

Parameters:
  • folder_a (AbstractFolder) – first folder object.

  • folder_b (AbstractFolder) – second folder object.

  • reporter (ProgressReport) – reporter object

  • policies_manager (ScanPoliciesManager) – policies manager object

  • folder_a

  • folder_b

Return type:

tuple[Optional[AbstractPath], Optional[AbstractPath]]

Returns:

yields two element tuples

class b2sdk._internal.scan.scan.AbstractScanResult[source]

Bases: object

Some attributes of files which are meaningful for monitoring and troubleshooting.

abstract classmethod from_files(*files)[source]
Parameters:

files (Optional[AbstractPath]) –

Return type:

AbstractScanResult

__init__()
class b2sdk._internal.scan.scan.AbstractScanReport[source]

Bases: object

Aggregation of valuable information about files after scanning.

SCAN_RESULT_CLASS

alias of AbstractScanResult

abstract add(*files)[source]
Parameters:

files (Optional[AbstractPath]) –

Return type:

None

__init__()
class b2sdk._internal.scan.scan.CountAndSampleScanReport(counter_by_status=<factory>, samples_by_status_first=<factory>, samples_by_status_last=<factory>)[source]

Bases: AbstractScanReport

Scan report which groups and counts files by their AbstractScanResult and also stores first and last seen examples of such files.

Parameters:
counter_by_status: Counter
samples_by_status_first: dict[AbstractScanResult, tuple[FileVersion, ...]]
samples_by_status_last: dict[AbstractScanResult, tuple[FileVersion, ...]]
add(*files)[source]
Parameters:

files (Optional[AbstractPath]) –

Return type:

None

__init__(counter_by_status=<factory>, samples_by_status_first=<factory>, samples_by_status_last=<factory>)
Parameters: