예제 #1
0
 def __init__(self, name, conf=None, binlog=True, size=None):
     conf = dict(self._conf, **conf.get('env', {})) if conf else self._conf
     if size: conf['map_size'] = size
     self._tables = {}
     self._env = Environment(name, **conf)
     self._db = self._env.open_db()
     self._transaction = None
     try:
         self._binlog = self.env.open_db('__binlog__'.encode(),
                                         create=binlog)
     except NotFoundError:
         self._binlog = None
     try:
         self._metadata = self.env.open_db('__metadata__'.encode(),
                                           create=False)
     except NotFoundError:
         self.migrate_metadata()
예제 #2
0
    def __init(self):
        create = not self.readonly

        self.env = Environment(self.databasePath,
                               map_size=3e9,
                               subdir=False,
                               max_dbs=64,
                               mode=0,
                               create=create,
                               readonly=self.readonly)
        self.descriptorToDb = {}
        self.nextIds = {}

        self.__addDb(SceneSetup, create=create)
        self.__addDb(ScatterSample, create=create)
        self.__addDb(DisneyDescriptor, create=create)
        self.__addDb(BakedInterpolationSet, create=create)
        self.__addDb(Result, create=create)