Esempio n. 1
0
    def __init__(self, db_path: str, writeback=False):
        Mapping.__init__(self)
        if '.' in db_path:
            if db_path.split('.')[-1] == 'db':
                path = db_path
            else:
                path = '.'.join([db_path, 'db'])
        else:
            path = '.'.join([db_path, 'db'])

        self.__path__ = path
        self.__db__ = shelve.open(self.__path__,
                                  writeback=writeback,
                                  protocol=None)
        self.__closed__ = False  # tag whether db is closed
        logging.info('Connected to shelve database {}'.format(path))
Esempio n. 2
0
    def __init__(self, path: str):
        Mapping.__init__(self)
        Sized.__init__(self)

        os.makedirs(path, exist_ok=True)
        self.__path__ = path
Esempio n. 3
0
 def __init__(self):
     """
     """
     Mapping.__init__(self)
     self.resiNumbers = defaultdict(list)
Esempio n. 4
0
 def __init__(self):
     """
     """
     Mapping.__init__(self)
     self.atomTypes = defaultdict(list)