def __check_setup(self): """ Auxiliary stuff that needs to be checked per run. Is there a database? Are the config files there? """ if not Config.is_first_setup(): self._db = sqlite3.connect(Config.db_path()) return Config.bootstrap() self._db = sqlite3.connect(Config.db_path()) Bookmark.create_table(self.db)
def insert(args): if not CLIParser._proper_arr_size(args, 5): return session = Session() name, title, = args[0], args[1] volume, chapter, page = int(args[2]), int(args[3]), int(args[4]) bm = Bookmark(session, name, title, volume, chapter, page) ins = Insert(bm) ins.execute()
def execute(self): sess = Session() for bm in Bookmark.select_all(sess): print(bm)