owmeta_core.capability_providers module

Classes for managing things in the owmeta-core project directory, typically named .owm

class owmeta_core.capability_providers.SimpleCacheDirectoryProvider(cache_directory, **kwargs)[source]

Bases: CacheDirectoryProvider

Provides a directory for caching remote resources as local files

class owmeta_core.capability_providers.SimpleDataSourceDirProvider(basedir)[source]

Bases: OutputFilePathProvider

Provides a directory under the provided base directory

class owmeta_core.capability_providers.SimpleTemporaryDirectoryProvider(base_directory, suffix=None, prefix=None, **kwargs)[source]

Bases: TemporaryDirectoryProvider

Provides temporary directories under a given base directory

class owmeta_core.capability_providers.TDSDPHelper(basedir, key, transaction_manager)[source]

Bases: FilePathProvider, OutputFilePathProvider

This provider relies on the transaction library’s machinery to manage the transaction.

Consistency is NOT guaranteed in all cases: in particular, this provider uses a file-based locking mechanism with a "lock file" in the given base directory which, if it’s deleted during the two-phase commit process, removes the isolation of the changes made in the directory.

sortKey()[source]

See also

transaction.interfaces.IDataManager
class owmeta_core.capability_providers.TransactionalDataSourceDirProvider(basedir, transaction_manager)[source]

Bases: OutputFilePathProvider, FilePathProvider

Provides a DataSourceDirectoryProvider with transactional semantics.

Provides a TDSDPHelper for DataSource objects, indexed by the DataSource identifier. If asked to provide a FilePathCapability (i.e, a directory for input), and the DataSource is a LocalFileDataSource, then we’ll check that a file named with the value of file_name is in the provided directory.

class owmeta_core.capability_providers.WorkingDirectoryProvider(cwd=None, **kwargs)[source]

Bases: FilePathProvider

Provides file paths from the current working directory for data_trans.local_file_ds.LocalFileDataSource instances.

Parameters
cwdstr or pathlib.Path, optional

The working directory to use. The default is what os.getcwd returns

owmeta_core.capability_providers.getrandbits(k) x.  Generates an int with k random bits.