From 76c724c78355605849bf02bdc68e68fedcf79d2d Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 13 Sep 2020 21:37:31 -0400 Subject: [PATCH] Remove global session object, this is now wrapped in the CalibreDB class --- cps/db.py | 5 ----- cps/tasks/convert.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cps/db.py b/cps/db.py index 48d2247d..66795f7e 100644 --- a/cps/db.py +++ b/cps/db.py @@ -51,8 +51,6 @@ try: except ImportError: use_unidecode = False -Session = None - cc_exceptions = ['datetime', 'comments', 'composite', 'series'] cc_classes = {} @@ -439,9 +437,6 @@ class CalibreDB(): cls.config = config cls.dispose() - # todo: remove...? - global Session - if not config.config_calibre_dir: config.invalidate() return False diff --git a/cps/tasks/convert.py b/cps/tasks/convert.py index 2b679fc0..8179de9f 100644 --- a/cps/tasks/convert.py +++ b/cps/tasks/convert.py @@ -53,7 +53,7 @@ class TaskConvert(CalibreTask): def _convert_ebook_format(self): error_message = None - local_session = db.Session() + local_session = db.CalibreDB() file_path = self.file_path book_id = self.bookid format_old_ext = u'.' + self.settings['old_book_format'].lower()