errbot.storage.shelf module

class errbot.storage.shelf.ShelfStorage(path)[source]

Bases: errbot.storage.base.StorageBase

__init__(path)[source]

Initialize self. See help(type(self)) for accurate signature.

close() → None[source]

Sync and close the storage. The caller of close will protect against close on non open and double close.

get(key: str) → Any[source]

Get the value stored for key. Raises KeyError if the key doesn’t exist. The caller of get will protect against get on non open.

Parameters:key (str) – the key
Returns:the value
keys()[source]
Returns:an iterator on all the entries
len()[source]
Returns:the number of keys set.
remove(key: str)[source]

Remove key. Raises KeyError if the key doesn’t exist. The caller of get will protect against get on non open.

Parameters:key (str) – the key
set(key: str, value: Any) → None[source]

Atomically set the key to the given value. The caller of set will protect against set on non open.

Parameters:
  • key (str) – string as key
  • value – pickalable python object
class errbot.storage.shelf.ShelfStoragePlugin(bot_config)[source]

Bases: errbot.storage.base.StoragePluginBase

__init__(bot_config)[source]

Initialize self. See help(type(self)) for accurate signature.

open(namespace: str) → errbot.storage.base.StorageBase[source]

Open the storage with the given namespace (core, or plugin name) and config. The caller of open will protect against double opens.

Return type:StorageBase
Parameters:namespace (str) – a namespace to isolate the plugin storages.
Returns: