Skip to content
Snippets Groups Projects
  • Holger's avatar
    e7f68832
    Preparing release 0.24.0 · e7f68832
    Holger authored
    * new beemstorage module
    * Config is handled by SqliteConfigurationStore or InRamConfigurationStore
    * Keys are handled by SqliteEncryptedKeyStore or InRamPlainKeyStore
    * Move aes to beemgraphenebase
    * Wallet.keys, Wallet.keyStorage, Wallet.token and Wallet.keyMap has been removed
    * Wallet.store has now the Key Interface that handles key management
    * Token handling has been removed from Wallet
    * Token storage has been move from wallet to SteemConnect/HiveSigner
    e7f68832
    History
    Preparing release 0.24.0
    Holger authored
    * new beemstorage module
    * Config is handled by SqliteConfigurationStore or InRamConfigurationStore
    * Keys are handled by SqliteEncryptedKeyStore or InRamPlainKeyStore
    * Move aes to beemgraphenebase
    * Wallet.keys, Wallet.keyStorage, Wallet.token and Wallet.keyMap has been removed
    * Wallet.store has now the Key Interface that handles key management
    * Token handling has been removed from Wallet
    * Token storage has been move from wallet to SteemConnect/HiveSigner
ram.py 1.06 KiB
# -*- coding: utf-8 -*-
# Inspired by https://raw.githubusercontent.com/xeroc/python-graphenelib/master/graphenestorage/ram.py
from .interfaces import StoreInterface


# StoreInterface is done first, then dict which overwrites the interface
# methods
class InRamStore(StoreInterface):
    """ The InRamStore inherits
        :class:`beemstorage.interfaces.StoreInterface` and extends it by two
        further calls for wipe and delete.

        The store is syntactically equivalent to a regular dictionary.

        .. warning:: If you are trying to obtain a value for a key that does
            **not** exist in the store, the library will **NOT** raise but
            return a ``None`` value. This represents the biggest difference to
            a regular ``dict`` class.
    """

    # Specific for this library
    def delete(self, key):
        """ Delete a key from the store
        """
        self.pop(key, None)

    def wipe(self):
        """ Wipe the store
        """
        keys = list(self.keys()).copy()
        for key in keys:
            self.delete(key)