owmeta_core.commands.bundle module

Bundle commands

exception owmeta_core.commands.bundle.BundleNotFound(bundle_id, bundle_version=None)[source]

Bases: GenericUserError

Thrown when a bundle cannot be found with the requested ID and version

exception owmeta_core.commands.bundle.NoBundleLoader(bundle_id, bundle_version=None)[source]

Bases: GenericUserError

Thrown when a loader can’t be found for a bundle

class owmeta_core.commands.bundle.OWMBundle(parent)[source]

Bases: object

Bundle commands

checkout(bundle_id)[source]

Switch to the named bundle

Parameters
bundle_idstr

ID of the bundle to switch to

deploy(bundle_id, version=None, remotes=None)[source]

Deploys a bundle to a remote. The target remotes come from project and user settings or, if provided, the remotes parameter

Parameters
bundle_idstr

ID of the bundle to deploy

versionint

Version of the bundle to deploy. optional.

remotesstr

Names of the remotes to deploy to. optional.

deregister(bundle_id)[source]

Remove a bundle from the project

Parameters
bundle_idstr

The id of the bundle to deregister

fetch(bundle_id, bundle_version=None, bundles_directory=None)[source]

Retrieve a bundle by id from a remote and put it in the local bundle index and cache

Parameters
bundle_idstr

The id of the bundle to retrieve.

bundle_versionint

The version of the bundle to retrieve. optional

bundles_directorystr

Root directory of the bundles cache. optional: uses the default bundle cache in the user’s home directory if not provided

install(bundle)[source]

Install the bundle to the local bundle repository for use across projects on the same machine

Parameters
bundlestr

ID of the bundle to install or path to the bundle descriptor

list()[source]

List registered bundles in the current project.

To list bundles within the local repo or a remote repo, use the cache list sub-command.

load(input_file_name)[source]

Load a bundle from a file and register it into the project

Parameters
input_file_namestr

The source file of the bundle

register(descriptor)[source]

Register a bundle within the project

Registering a bundle adds it to project configuration and records where the descriptor file is within the project’s working tree. If the descriptor file moves it must be re-registered at the new location.

Parameters
descriptorstr

Descriptor file for the bundle

save(bundle_id, output, bundle_version=None)[source]

Write an installed bundle to a file

Writing the bundle to a file means writing the bundle manifest, constituent graphs, and attached files to an archive. The bundle can be in the local bundle repository, a remote, or registered in the project.

Parameters
bundle_idstr

The bundle to save

outputstr

The target file

bundle_versionint

Version of the bundle to write. optional: defaults to the latest installed bundle

cache

OWMBundleCache: Bundle cache commands

remote

OWMBundleRemote: Commands for dealing with bundle remotes

class owmeta_core.commands.bundle.OWMBundleCache(parent)[source]

Bases: object

Bundle cache commands

list()[source]

List bundles in the cache

class owmeta_core.commands.bundle.OWMBundleRemote(parent)[source]

Bases: object

Commands for dealing with bundle remotes

list()[source]

List remotes

remove(name)[source]

Remove the remote

Parameters
namestr

Name of the remote

show(name)[source]

Show details about a remote

Parameters
namestr

Name of the remote

add

OWMBundleRemoteAdd: Add a remote and, optionally, an accessor to that remote.

Remotes contain zero or more “accessor configurations” which describe how to upload to and download from a remote. Sub-commands allow for specifying additional parameters specific to a type of accessor.

update

OWMBundleRemoteUpdate: Update a remote accessor

Remotes contain zero or more “accessor configurations” which describe how to upload to and download from a remote. Sub-commands allow for specifying additional parameters specific to a type of accessor.

user

If this option is provided, then remotes in the user profile directory are used rather than those in the project directory.

class owmeta_core.commands.bundle.OWMBundleRemoteAdd(parent)[source]

Bases: _OWMBundleRemoteAddUpdate

Add a remote and, optionally, an accessor to that remote.

Remotes contain zero or more “accessor configurations” which describe how to upload to and download from a remote. Sub-commands allow for specifying additional parameters specific to a type of accessor.

class owmeta_core.commands.bundle.OWMBundleRemoteUpdate(parent)[source]

Bases: _OWMBundleRemoteAddUpdate

Update a remote accessor

Remotes contain zero or more “accessor configurations” which describe how to upload to and download from a remote. Sub-commands allow for specifying additional parameters specific to a type of accessor.