class BeaconsFilePersistence(BeaconsMemoryPersistence):
    def __init__(self, path: str = None):
        super(BeaconsFilePersistence, self).__init__()

        self._persister = JsonFilePersister(path)
        self._loader = self._persister
        self._saver = self._persister

    def configure(self, config: ConfigParams):
        super(BeaconsFilePersistence, self).configure(config)
        self._persister.configure(config)
Exemplo n.º 2
0
class DummyFilePersistence(DummyMemoryPersistence):
    _persister = None

    def __init__(self, path=None):
        super(DummyFilePersistence, self).__init__()

        self._persister = JsonFilePersister(path)
        self._loader = self._persister
        self._saver = self._persister

    def configure(self, config):
        super(DummyFilePersistence, self).configure(config)
        self._persister.configure(config)