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))
def __init__(self, path: str): Mapping.__init__(self) Sized.__init__(self) os.makedirs(path, exist_ok=True) self.__path__ = path
def __init__(self): """ """ Mapping.__init__(self) self.resiNumbers = defaultdict(list)
def __init__(self): """ """ Mapping.__init__(self) self.atomTypes = defaultdict(list)