def get_db_url(self):
    with open(self.dbpass_path, 'r') as infile:
        db_names = []
        for raw_url in infile.read().splitlines():
            url_obj = make_url(raw_url)
            if (url_obj.database == self.dbname):
                infile.close()
                return raw_url
            db_names.append(url_obj.database)
    infile.close()
    exit(('database name does not exist in dbpass given:' + ', '.join(db_names)))
def get_db_url(self):
    with open(self.dbpass_path, 'r') as infile:
        db_names = []
        for raw_url in infile.read().splitlines():
            url_obj = make_url(raw_url)
            if (url_obj.database == self.dbname):
                infile.close()
                return raw_url
            db_names.append(url_obj.database)
    infile.close()
    exit(('database name does not exist in dbpass given:' + ', '.join(db_names)))