MoinMoin.storage package

Submodules

MoinMoin.storage.error module

MoinMoin storage errors

exception MoinMoin.storage.error.BackendError(message)[source]

Bases: MoinMoin.storage.error.StorageError

Raised if the backend couldn’t commit the action.

exception MoinMoin.storage.error.ItemAlreadyExistsError(message)[source]

Bases: MoinMoin.storage.error.BackendError

Raised if the Item you are trying to create already exists.

exception MoinMoin.storage.error.NoSuchItemError(message)[source]

Bases: MoinMoin.storage.error.BackendError

Raised if the requested item does not exist.

exception MoinMoin.storage.error.NoSuchRevisionError(message)[source]

Bases: MoinMoin.storage.error.BackendError

Raised if the requested revision of an item does not exist.

exception MoinMoin.storage.error.RevisionAlreadyExistsError(message)[source]

Bases: MoinMoin.storage.error.BackendError

Raised if the Revision you are trying to create already exists.

exception MoinMoin.storage.error.StorageError(message)[source]

Bases: MoinMoin.error.CompositeError

General class for exceptions on the storage layer.

Module contents

MoinMoin - storage subsystem

We use a layered approach like this:

Indexing Middleware               does complex stuff like indexing, searching,
|                                 listing, lookup by name, ACL checks, ...
v
Routing  Middleware               dispatches to multiple backends based on the
|                 |               namespace
v                 v
"stores" Backend  Other Backend   simple stuff: store, get, destroy revisions
|           |
v           v
meta store  data store            simplest stuff: store, get, destroy and iterate
                                  over key/value pairs
MoinMoin.storage.backend_from_uri(uri)[source]

create a backend instance for uri

MoinMoin.storage.create_mapping(uri, namespaces, backends, acls)[source]
MoinMoin.storage.create_simple_mapping(uri='stores:fs:instance', default_acl=None, userprofiles_acl=None)[source]

When configuring storage, the admin needs to provide a namespace_mapping. To ease creation of such a mapping, this function provides sane defaults for different types of stores. The admin can just call this function, pass a hint on what type of stores he wants to use and a proper mapping is returned.

Params uri:

‘<backend_name>:<backend_uri>’ (general form) backend_name must be a backend module name (e.g. stores) the backend_uri must have a %(backend)s placeholder, it gets replaced by the name of the backend (a simple, ascii string) and result is given to to that backend’s constructor

for the ‘stores’ backend, backend_uri looks like ‘<store_name>:<store_uri>’ store_name must be a store module name (e.g. fs) the store_uri must have a %(kind)s placeholder, it gets replaced by ‘meta’ or ‘data’ and the result is given to that store’s constructor

e.g.: ‘stores:fs:/path/to/store/%(backend)s/%(kind)s’ will create a mapping using the ‘stores’ backend with ‘fs’ stores and everything will be stored to below /path/to/store/.