X-Git-Url: http://dolda2000.com/gitweb/?p=didex.git;a=blobdiff_plain;f=didex%2Fstore.py;h=43c134873e71bfbfa8898e20ee0d82fa2a309bcc;hp=8008ee51557bc99ec1b8e816e2b59cd31c850ae3;hb=d6d41a45b2882bf919cd7702d7590ead03e9d590;hpb=cbf73d3a70b97f17f1f5431eee1e73dbc56a7f8e diff --git a/didex/store.py b/didex/store.py index 8008ee5..43c1348 100644 --- a/didex/store.py +++ b/didex/store.py @@ -2,7 +2,7 @@ import threading, pickle from . import db, index, cache from .db import txnfun -__all__ = ["environment", "store", "autostore"] +__all__ = ["environment", "datastore", "autostore"] class environment(object): def __init__(self, *, path=None, getpath=None, recover=False): @@ -44,7 +44,7 @@ def storedescs(obj): t.__didex_attr = ret return ret -class store(object): +class datastore(object): def __init__(self, name, *, env=None, path=".", ncache=None): self.name = name self.lk = threading.Lock() @@ -107,6 +107,7 @@ class autotype(type): def __call__(self, *args, **kwargs): new = super().__call__(*args, **kwargs) new.id = self.store.register(new) + self.store.update(new.id, vfy=new) # This doesn't feel too nice. return new class autostore(object, metaclass=autotype):