owmeta_core.bundle.loaders package¶
Package for uploaders and downloaders of bundles
- exception owmeta_core.bundle.loaders.LoadFailed(bundle_id, loader, *args)[source]¶
Bases:
Exception
Thrown when a bundle could not be downloaded
- class owmeta_core.bundle.loaders.Loader[source]¶
Bases:
object
Downloads bundles into the local index and caches them
Note that a
Loader
is transient: it will be created when needed to download one bundle and then discarded. Any state that should be carried from request to request should be attached to anAccessorConfig
- Attributes
- base_directory
str
The path where the bundle archive should be unpacked
- base_directory
- bundle_versions(bundle_id)[source]¶
List the versions available for the bundle.
This is a required part of the
Loader
interface.
- can_load(bundle_id, bundle_version=None)[source]¶
Returns True if the bundle named
bundle_id
is available.This method is for loaders to determine that they probably can or cannot load the bundle, such as by checking repository metadata. Other loaders that return
True
fromcan_load
should be tried if a given loader fails, but a warning should be recorded for the loader that failed.
- classmethod can_load_from(accessor_config)[source]¶
Returns
True
if the givenaccessor_config
is a valid config for this loader- Parameters
- accessor_config
AccessorConfig
The config which we may be able to load from
- accessor_config
- load(bundle_id, bundle_version=None)[source]¶
Load the bundle into the local index
- Parameters
- Raises
LoadFailed
Raised when the bundle cannot be loaded
- class owmeta_core.bundle.loaders.Uploader[source]¶
Bases:
object
Uploads bundles to remotes
- can_upload(bundle_path)[source]¶
Returns True if this uploader can upload this bundle
- Parameters
- bundle_path
str
The file path to the bundle to upload
- bundle_path