Пример #1
0
 def __init__(self, fullpath):
     Memory.__init__(self)
     self._content = {}
     from pydsl.Memory.Search.Searcher import MemorySearcher
     self._searcher = MemorySearcher(self)
     from pydsl.Memory.File.Python import getFileTuple
     (_, _, fileBaseName, _) = getFileTuple(fullpath)
     import imp
     myobj = imp.load_source(fileBaseName, fullpath)
     for element in myobj.mylist:
         self._content[self._generatekey(element)] = element
Пример #2
0
 def __init__(self, dbname, allowedclass = None):
     Memory.__init__(self)
     self.identifier = dbname
     #store shelve path list
     #load/create each shelve path
     from pydsl.Config import GLOBALCONFIG
     if GLOBALCONFIG.persistent_dir:
         self.filename = GLOBALCONFIG.persistent_dir + "/" + dbname
     import threading
     self.lock = threading.Lock()
     self.allowedclass = allowedclass