b2sdk.sync.folder
– Folder¶
-
class
b2sdk.sync.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)[source]¶ Returns 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 – a place to report errors
policies_manager – a policies manager object
-
abstract
-
class
b2sdk.sync.folder.
B2Folder
(bucket_name, folder_name, api)[source]¶ Bases:
b2sdk.sync.folder.AbstractFolder
Folder interface to b2.
-
__init__
(bucket_name, folder_name, api)[source]¶ - Parameters
bucket_name (str) – a name of the bucket
folder_name (str) – a folder name
api (b2sdk.api.B2Api) – an API object
-
-
class
b2sdk.sync.folder.
LocalFolder
(root)[source]¶ Bases:
b2sdk.sync.folder.AbstractFolder
Folder interface to a directory on the local machine.
-
__init__
(root)[source]¶ Initializes a new folder.
- Parameters
root (str) – Path to the root of the local folder. Must be unicode.
-