b2sdk._internal.scan.folder
- class b2sdk._internal.scan.folder.AbstractFolder[source]
Bases:
object
Interface to a folder full of files, which might be a B2 bucket, a virtual folder in a B2 bucket, or a directory on a local file system.
Files in B2 may have multiple versions, while files in local folders have just one.
- abstract all_files(reporter, policies_manager=<b2sdk._internal.scan.policies.ScanPoliciesManager object>)[source]
Return an iterator over all of the files in the folder, in the order that B2 uses.
It also performs filtering using policies manager.
No matter what the folder separator on the local file system is, “/” is used in the returned file names.
If a file is found, but does not exist (for example due to a broken symlink or a race), reporter will be informed about each such problem.
- Parameters:
reporter (
Optional
[ProgressReport
]) – a place to report errorspolicies_manager – a policies manager object
- Return type:
- b2sdk._internal.scan.folder.join_b2_path(relative_dir_path, file_name)[source]
Like os.path.join, but for B2 file names where the root directory is called ‘’.
- class b2sdk._internal.scan.folder.LocalFolder(root)[source]
Bases:
AbstractFolder
Folder interface to a directory on the local machine.
- all_files(reporter, policies_manager=<b2sdk._internal.scan.policies.ScanPoliciesManager object>)[source]
Yield all files.
- class b2sdk._internal.scan.folder.B2Folder(bucket_name, folder_name, api)[source]
Bases:
AbstractFolder
Folder interface to b2.
- all_files(reporter, policies_manager=<b2sdk._internal.scan.policies.ScanPoliciesManager object>)[source]
Yield all files.
- Parameters:
reporter (
Optional
[ProgressReport
]) –policies_manager (
ScanPoliciesManager
) –
- Return type: