|
|
@ -7,7 +7,7 @@ class DataCache(object):
|
|
|
|
Has two roles :
|
|
|
|
Has two roles :
|
|
|
|
1. Provides a buffer between the commands and the hard drive.
|
|
|
|
1. Provides a buffer between the commands and the hard drive.
|
|
|
|
Until a command request a hard drive ressource, it does not touch it.
|
|
|
|
Until a command request a hard drive ressource, it does not touch it.
|
|
|
|
2. Keeps a up-to-date, pickled version of the repository, to speed up things
|
|
|
|
2. Keeps an up-to-date, pickled version of the repository, to speed up things
|
|
|
|
when they are a lot of files. Update are also done only when required.
|
|
|
|
when they are a lot of files. Update are also done only when required.
|
|
|
|
Changes are detected using data modification timestamps.
|
|
|
|
Changes are detected using data modification timestamps.
|
|
|
|
|
|
|
|
|
|
|
@ -46,18 +46,16 @@ class DataCache(object):
|
|
|
|
def remove(self, citekey):
|
|
|
|
def remove(self, citekey):
|
|
|
|
self.databroker.remove(citekey)
|
|
|
|
self.databroker.remove(citekey)
|
|
|
|
|
|
|
|
|
|
|
|
def exists(self, citekey, both=True):
|
|
|
|
def exists(self, citekey, meta_check=False):
|
|
|
|
return self.databroker.exists(citekey, both=both)
|
|
|
|
return self.databroker.exists(citekey, meta_check=meta_check)
|
|
|
|
|
|
|
|
|
|
|
|
def citekeys(self):
|
|
|
|
def citekeys(self):
|
|
|
|
listings = self.listing(filestats=False)
|
|
|
|
return self.databroker.citekeys()
|
|
|
|
return set(listings['metafiles']).intersection(listings['bibfiles'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def listing(self, filestats=True):
|
|
|
|
def listing(self, filestats=True):
|
|
|
|
return self.databroker.listing(filestats=filestats)
|
|
|
|
return self.databroker.listing(filestats=filestats)
|
|
|
|
|
|
|
|
|
|
|
|
def verify(self, bibdata_raw):
|
|
|
|
def verify(self, bibdata_raw):
|
|
|
|
"""Will return None if bibdata_raw can't be decoded"""
|
|
|
|
|
|
|
|
return self.databroker.verify(bibdata_raw)
|
|
|
|
return self.databroker.verify(bibdata_raw)
|
|
|
|
|
|
|
|
|
|
|
|
# docbroker
|
|
|
|
# docbroker
|
|
|
|