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:
CacheDirectoryProviderProvides a directory for caching remote resources as local files
- class owmeta_core.capability_providers.SimpleDataSourceDirProvider(basedir)[source]¶
Bases:
OutputFilePathProviderProvides a directory under the provided base directory
- class owmeta_core.capability_providers.SimpleTemporaryDirectoryProvider(base_directory, suffix=None, prefix=None, **kwargs)[source]¶
Bases:
TemporaryDirectoryProviderProvides temporary directories under a given base directory
- class owmeta_core.capability_providers.TDSDPHelper(basedir, key, transaction_manager)[source]¶
Bases:
FilePathProvider,OutputFilePathProviderThis provider relies on the
transactionlibrary’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.
- class owmeta_core.capability_providers.TransactionalDataSourceDirProvider(basedir, transaction_manager)[source]¶
Bases:
OutputFilePathProvider,FilePathProviderProvides a DataSourceDirectoryProvider with transactional semantics.
Provides a
TDSDPHelperforDataSourceobjects, indexed by theDataSourceidentifier. If asked to provide aFilePathCapability(i.e, a directory for input), and theDataSourceis aLocalFileDataSource, then we’ll check that a file named with the value offile_nameis in the provided directory.
- class owmeta_core.capability_providers.WorkingDirectoryProvider(cwd=None, **kwargs)[source]¶
Bases:
FilePathProviderProvides file paths from the current working directory for
data_trans.local_file_ds.LocalFileDataSourceinstances.- Parameters
- cwd
strorpathlib.Path,optional The working directory to use. The default is what
os.getcwdreturns
- cwd
- owmeta_core.capability_providers.getrandbits(k) x. Generates an int with k random bits.¶