From 344c0c7bc30d505fcb83d90df78b7f62ce9372b0 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Tue, 26 Nov 2024 20:22:20 +0100 Subject: [PATCH] Bugfixes after testrun --- cps/admin.py | 11 +- cps/db.py | 4 +- cps/editbooks.py | 1 + cps/tasks/convert.py | 62 +- cps/tasks/metadata_backup.py | 24 +- test/Calibre-Web TestSummary_Linux.html | 6587 ++++++++++++----------- 6 files changed, 3498 insertions(+), 3191 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index b56b5b5c..943abe92 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -118,7 +118,7 @@ def before_request(): g.allow_upload = config.config_uploading g.current_theme = config.config_theme g.config_authors_max = config.config_authors_max - if '/static/' not in request.path and not config.db_configured and \ + if ('/static/' not in request.path and not config.db_configured and request.endpoint not in ('admin.ajax_db_config', 'admin.simulatedbchange', 'admin.db_configuration', @@ -126,7 +126,7 @@ def before_request(): 'web.login_post', 'web.logout', 'admin.load_dialogtexts', - 'admin.ajax_pathchooser'): + 'admin.ajax_pathchooser')): return redirect(url_for('admin.db_configuration')) @@ -1736,14 +1736,12 @@ def _db_configuration_update_helper(): return _db_configuration_result(_("Books path not valid"), gdrive_error) else: _config_string(to_save, "config_calibre_split_dir") - - if db_change or not db_valid or not config.db_configured \ - or config.config_calibre_dir != to_save["config_calibre_dir"]: + if (db_change or not db_valid or not config.db_configured + or config.config_calibre_dir != to_save["config_calibre_dir"]): if not os.path.exists(metadata_db) or not to_save['config_calibre_dir']: return _db_configuration_result(_('DB Location is not Valid, Please Enter Correct Path'), gdrive_error) else: calibre_db.setup_db(to_save['config_calibre_dir'], ub.app_DB_path) - config.store_calibre_uuid(calibre_db, db.Library_Id) # if db changed -> delete shelfs, delete download books, delete read books, kobo sync... if db_change: log.info("Calibre Database changed, all Calibre-Web info related to old Database gets deleted") @@ -1767,6 +1765,7 @@ def _db_configuration_update_helper(): config.config_read_column = 0 _config_string(to_save, "config_calibre_dir") calibre_db.update_config(config, config.config_calibre_dir, ub.app_DB_path) + config.store_calibre_uuid(calibre_db, db.Library_Id) if not os.access(os.path.join(config.config_calibre_dir, "metadata.db"), os.W_OK): flash(_("DB is not Writeable"), category="warning") calibre_db.update_config(config, config.config_calibre_dir, ub.app_DB_path) diff --git a/cps/db.py b/cps/db.py index 47ea6a5c..38b3f07f 100644 --- a/cps/db.py +++ b/cps/db.py @@ -538,7 +538,7 @@ class CalibreDB: self.Session = None #if init: # self.init_db(expire_on_commit) - if _app is not None: + if _app is not None and not _app._got_first_request: self.init_app(_app) def init_app(self, _app): @@ -1072,7 +1072,7 @@ class CalibreDB: # self.dispose() # self.engine.dispose() self.setup_db(config.config_calibre_dir, app_db_path) - self.update_config(config) + self.update_config(config, config.config_calibre_dir, app_db_path) def lcase(s): diff --git a/cps/editbooks.py b/cps/editbooks.py index 2d323a52..d5d92453 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -215,6 +215,7 @@ def table_get_custom_enum(c_id): def edit_list_book(param): vals = request.form.to_dict() book = calibre_db.get_book(vals['pk']) + calibre_db.create_functions(config) sort_param = "" ret = "" try: diff --git a/cps/tasks/convert.py b/cps/tasks/convert.py index 9b39c6c2..e0df3802 100644 --- a/cps/tasks/convert.py +++ b/cps/tasks/convert.py @@ -60,6 +60,8 @@ class TaskConvert(CalibreTask): self.results = dict() def run(self, worker_thread): + df_cover = None + cur_book = None self.worker_thread = worker_thread if config.config_use_google_drive: with app.app_context(): @@ -90,38 +92,38 @@ class TaskConvert(CalibreTask): format=self.settings['old_book_format'], fn=data.name + "." + self.settings['old_book_format'].lower()) # worker_db.session.close() - return self._handleError(error_message) + return self._handleError(error_message) - filename = self._convert_ebook_format() + filename = self._convert_ebook_format() + if config.config_use_google_drive: + os.remove(self.file_path + '.' + self.settings['old_book_format'].lower()) + if df_cover: + os.remove(os.path.join(config.config_calibre_dir, cur_book.path, "cover.jpg")) + + if filename: if config.config_use_google_drive: - os.remove(self.file_path + '.' + self.settings['old_book_format'].lower()) - if df_cover: - os.remove(os.path.join(config.config_calibre_dir, cur_book.path, "cover.jpg")) - - if filename: - if config.config_use_google_drive: - # Upload files to gdrive - gdriveutils.updateGdriveCalibreFromLocal() - self._handleSuccess() - if self.ereader_mail: - # if we're sending to E-Reader after converting, create a one-off task and run it immediately - # todo: figure out how to incorporate this into the progress - try: - EmailText = N_(u"%(book)s send to E-Reader", book=escape(self.title)) - for email in self.ereader_mail.split(','): - email = strip_whitespaces(email) - worker_thread.add(self.user, TaskEmail(self.settings['subject'], - self.results["path"], - filename, - self.settings, - email, - EmailText, - self.settings['body'], - id=self.book_id, - internal=True) - ) - except Exception as ex: - return self._handleError(str(ex)) + # Upload files to gdrive + gdriveutils.updateGdriveCalibreFromLocal() + self._handleSuccess() + if self.ereader_mail: + # if we're sending to E-Reader after converting, create a one-off task and run it immediately + # todo: figure out how to incorporate this into the progress + try: + EmailText = N_(u"%(book)s send to E-Reader", book=escape(self.title)) + for email in self.ereader_mail.split(','): + email = strip_whitespaces(email) + worker_thread.add(self.user, TaskEmail(self.settings['subject'], + self.results["path"], + filename, + self.settings, + email, + EmailText, + self.settings['body'], + id=self.book_id, + internal=True) + ) + except Exception as ex: + return self._handleError(str(ex)) def _convert_ebook_format(self): error_message = None diff --git a/cps/tasks/metadata_backup.py b/cps/tasks/metadata_backup.py index dc5b8404..048fcf7c 100644 --- a/cps/tasks/metadata_backup.py +++ b/cps/tasks/metadata_backup.py @@ -47,35 +47,35 @@ class TaskBackupMetadata(CalibreTask): def set_all_books_dirty(self): with app.app_context(): - calibre_db = db.CalibreDB(app) + calibre_dbb = db.CalibreDB(app) try: - books = calibre_db.session.query(db.Books).all() + books = calibre_dbb.session.query(db.Books).all() for book in books: - calibre_db.set_metadata_dirty(book.id) - calibre_db.session.commit() + calibre_dbb.set_metadata_dirty(book.id) + calibre_dbb.session.commit() self._handleSuccess() except Exception as ex: self.log.debug('Error adding book for backup: ' + str(ex)) self._handleError('Error adding book for backup: ' + str(ex)) - calibre_db.session.rollback() + calibre_dbb.session.rollback() # self.calibre_db.session.close() def backup_metadata(self): with app.app_context(): try: - calibre_db = db.CalibreDB(app) - metadata_backup = calibre_db.session.query(db.Metadata_Dirtied).all() - custom_columns = (calibre_db.session.query(db.CustomColumns) + calibre_dbb = db.CalibreDB(app) + metadata_backup = calibre_dbb.session.query(db.Metadata_Dirtied).all() + custom_columns = (calibre_dbb.session.query(db.CustomColumns) .filter(db.CustomColumns.mark_for_delete == 0) .filter(db.CustomColumns.datatype.notin_(db.cc_exceptions)) .order_by(db.CustomColumns.label).all()) count = len(metadata_backup) i = 0 for backup in metadata_backup: - book = calibre_db.session.query(db.Books).filter(db.Books.id == backup.book).one_or_none() - calibre_db.session.query(db.Metadata_Dirtied).filter( + book = calibre_dbb.session.query(db.Books).filter(db.Books.id == backup.book).one_or_none() + calibre_dbb.session.query(db.Metadata_Dirtied).filter( db.Metadata_Dirtied.book == backup.book).delete() - calibre_db.session.commit() + calibre_dbb.session.commit() if book: self.open_metadata(book, custom_columns) else: @@ -89,7 +89,7 @@ class TaskBackupMetadata(CalibreTask): b = "NaN" if not hasattr(book, 'id') else book.id self.log.debug('Error creating metadata backup for book {}: '.format(b) + str(ex)) self._handleError('Error creating metadata backup: ' + str(ex)) - calibre_db.session.rollback() + calibre_dbb.session.rollback() # self.calibre_db.session.close() def open_metadata(self, book, custom_columns): diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 234bfb96..ec9f87ce 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2024-11-25 20:45:11

+

Start Time: 2024-11-27 21:25:16

-

Stop Time: 2024-11-26 02:45:09

+

Stop Time: 2024-11-28 03:32:55

-

Duration: 4h 59 min

+

Duration: 5h 7 min

@@ -234,12 +234,12 @@ - + TestBackupMetadata 21 - 16 - 4 - 1 + 21 + 0 + 0 0 Detail @@ -248,67 +248,20 @@ - +
TestBackupMetadata - test_backup_all
- -
- FAIL -
- - - - + PASS - +
TestBackupMetadata - test_backup_change_book_author
- -
- FAIL -
- - - - + PASS @@ -322,31 +275,11 @@ First extra element 0: - +
TestBackupMetadata - test_backup_change_book_identifier
- -
- FAIL -
- - - - + PASS @@ -369,31 +302,11 @@ AssertionError: 0 != 2 - +
TestBackupMetadata - test_backup_change_book_publishing_date
- -
- ERROR -
- - - - + PASS @@ -425,32 +338,11 @@ AttributeError: 'str' object has no attribute 'date' - +
TestBackupMetadata - test_backup_change_book_title
- -
- FAIL -
- - - - + PASS @@ -546,13 +438,13 @@ AssertionError: '' != 'Buuko' - + TestBackupMetadataGdrive 1 - 0 - 0 1 0 + 0 + 0 Detail @@ -560,19 +452,495 @@ AssertionError: '' != 'Buuko' - +
TestBackupMetadataGdrive - test_backup_gdrive
+ PASS + + + + + + + TestCli + 13 + 11 + 2 + 0 + 0 + + Detail + + + + + + + +
TestCli - test_already_started
+ + PASS + + + + + + +
TestCli - test_bind_to_single_interface
+ + PASS + + + + + + +
TestCli - test_change_password
+ + PASS + + + + + + +
TestCli - test_cli_SSL_files
+ + PASS + + + + + + +
TestCli - test_cli_different_folder
+ + PASS + + + + + + +
TestCli - test_cli_different_settings_database
+ + PASS + + + + + + +
TestCli - test_dryrun_update
+ + PASS + + + + + + +
TestCli - test_enable_reconnect
+ + PASS + + + + + + +
TestCli - test_environ_port_setting
+ + PASS + + + + + + +
TestCli - test_logfile
+ + PASS + + + + + + +
TestCli - test_no_database
+
- ERROR + FAIL
-
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 736, in test_edit_custom_categories
+  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 738, in test_edit_custom_categories
     self.assertEqual(len(self.adv_search({u'custom_column_6': u'人 Ü'})), 0)
 TypeError: object of type 'bool' has no len()
@@ -3886,7 +5144,7 @@ TypeError: object of type 'bool' has no len()
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 753, in test_edit_custom_float
+  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 755, in test_edit_custom_float
     self.assertEqual(len(self.adv_search({'custom_column_8_low': '-2.5'})), 0)
 TypeError: object of type 'bool' has no len()
@@ -3915,7 +5173,7 @@ TypeError: object of type 'bool' has no len()
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 774, in test_edit_custom_int
+  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 776, in test_edit_custom_int
     self.assertEqual(len(self.adv_search({u'custom_column_4_low': u'0'})), 0)
 TypeError: object of type 'bool' has no len()
@@ -3944,7 +5202,7 @@ TypeError: object of type 'bool' has no len()
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 684, in test_edit_custom_rating
+  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 686, in test_edit_custom_rating
     self.assertEqual(len(self.adv_search({u'custom_column_1': u'3'})), 0)
 TypeError: object of type 'bool' has no len()
@@ -3973,7 +5231,7 @@ TypeError: object of type 'bool' has no len()
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 703, in test_edit_custom_single_select
+  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 705, in test_edit_custom_single_select
     self.assertEqual(len(self.adv_search({u'custom_column_9': u'人物'})), 0)
 TypeError: object of type 'bool' has no len()
@@ -4002,7 +5260,7 @@ TypeError: object of type 'bool' has no len()
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 719, in test_edit_custom_text
+  File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 721, in test_edit_custom_text
     self.assertEqual(len(self.adv_search({u'custom_column_10': u'人 Ä'})), 0)
 TypeError: object of type 'bool' has no len()
@@ -4062,12 +5320,12 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7031c9304670>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f1407d31ff0>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 596, in test_edit_language + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 598, in test_edit_language self.get_book_details(3) File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1464, in get_book_details cls.driver.get(root_url + "/book/" + str(id)) @@ -4095,7 +5353,7 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=55101): Max retries exceeded with url: /session/c12963c5-b8e2-4d16-acb3-8dad08addce3/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7031c9304670>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=44323): Max retries exceeded with url: /session/675eac0b-8327-4776-a9d7-69d4b4655190/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1407d31ff0>: Failed to establish a new connection: [Errno 111] Connection refused'))
@@ -4153,12 +5411,12 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7031c9306fb0>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f140873de70>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 542, in test_edit_publisher + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 544, in test_edit_publisher self.get_book_details(7) File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1464, in get_book_details cls.driver.get(root_url + "/book/" + str(id)) @@ -4186,7 +5444,7 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=55101): Max retries exceeded with url: /session/c12963c5-b8e2-4d16-acb3-8dad08addce3/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7031c9306fb0>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=44323): Max retries exceeded with url: /session/675eac0b-8327-4776-a9d7-69d4b4655190/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f140873de70>: Failed to establish a new connection: [Errno 111] Connection refused'))
@@ -4244,12 +5502,12 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7031c9307520>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f1405f269e0>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 626, in test_edit_rating + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 628, in test_edit_rating books = self.get_books_displayed() File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1229, in get_books_displayed html = cls.driver.page_source @@ -4277,7 +5535,7 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=55101): Max retries exceeded with url: /session/c12963c5-b8e2-4d16-acb3-8dad08addce3/source (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7031c9307520>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=44323): Max retries exceeded with url: /session/675eac0b-8327-4776-a9d7-69d4b4655190/source (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1405f269e0>: Failed to establish a new connection: [Errno 111] Connection refused'))
@@ -4335,12 +5593,12 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7031c9304c70>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f140697e410>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 422, in test_edit_series + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 424, in test_edit_series self.get_book_details(9) File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1464, in get_book_details cls.driver.get(root_url + "/book/" + str(id)) @@ -4368,7 +5626,7 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=55101): Max retries exceeded with url: /session/c12963c5-b8e2-4d16-acb3-8dad08addce3/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7031c9304c70>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=44323): Max retries exceeded with url: /session/675eac0b-8327-4776-a9d7-69d4b4655190/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f140697e410>: Failed to establish a new connection: [Errno 111] Connection refused'))
@@ -4426,12 +5684,12 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7031c94309d0>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f14069b3940>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 127, in test_edit_title + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 129, in test_edit_title self.fill_basic_config({"config_unicode_filename": 1}) File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 392, in fill_basic_config cls._fill_basic_config(elements) @@ -4465,7 +5723,7 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=55101): Max retries exceeded with url: /session/c12963c5-b8e2-4d16-acb3-8dad08addce3/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7031c94309d0>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=44323): Max retries exceeded with url: /session/675eac0b-8327-4776-a9d7-69d4b4655190/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f14069b3940>: Failed to establish a new connection: [Errno 111] Connection refused'))
@@ -4523,12 +5781,12 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7031c9431c90>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f1408bfd2a0>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 845, in test_upload_book_lit + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 847, in test_upload_book_lit self.fill_basic_config({'config_uploading': 1}) File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 392, in fill_basic_config cls._fill_basic_config(elements) @@ -4562,7 +5820,7 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=55101): Max retries exceeded with url: /session/c12963c5-b8e2-4d16-acb3-8dad08addce3/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7031c9431c90>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=44323): Max retries exceeded with url: /session/675eac0b-8327-4776-a9d7-69d4b4655190/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1408bfd2a0>: Failed to establish a new connection: [Errno 111] Connection refused'))
@@ -4620,12 +5878,12 @@ Traceback (most recent call last): conn = self._new_conn() File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( -urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7031c946f5e0>: Failed to establish a new connection: [Errno 111] Connection refused +urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f1405f26710>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 935, in test_watch_metadata + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 937, in test_watch_metadata button = self.check_element_on_page((By.ID, "enable_gdrive_watch")) File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 744, in check_element_on_page el = WebDriverWait(cls.driver, timeout).until(EC.presence_of_element_located(element)) @@ -4657,7 +5915,7 @@ Traceback (most recent call last): retries = retries.increment( File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) -urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=55101): Max retries exceeded with url: /session/c12963c5-b8e2-4d16-acb3-8dad08addce3/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7031c946f5e0>: Failed to establish a new connection: [Errno 111] Connection refused')) +urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=44323): Max retries exceeded with url: /session/675eac0b-8327-4776-a9d7-69d4b4655190/element (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1405f26710>: Failed to establish a new connection: [Errno 111] Connection refused'))
@@ -4812,12 +6070,12 @@ urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', p - + TestEmbedMetadata 6 - 2 - 2 - 2 + 6 + 0 + 0 0 Detail @@ -4826,62 +6084,20 @@ urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', p - +
TestEmbedMetadata - test_convert_file_embed_metadata
- -
- ERROR -
- - - - + PASS - +
TestEmbedMetadata - test_convert_kepub_embed_metadata
- -
- ERROR -
- - - - + PASS @@ -4895,60 +6111,20 @@ FileNotFoundError: [Errno 2] No such file or directory: '/home/ozzie/Develop - +
TestEmbedMetadata - test_download_kepub_embed_metadata
- -
- FAIL -
- - - - + PASS - +
TestEmbedMetadata - test_download_permissions_missing_file
- -
- FAIL -
- - - - + PASS @@ -4966,9 +6142,9 @@ AssertionError: 20746 != 5954 TestEmbedMetadataGdrive 4 - 0 - 0 - 4 + 1 + 1 + 2 0 Detail @@ -4994,71 +6170,13 @@ AssertionError: 20746 != 5954
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
-    conn = connection.create_connection(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/connection.py", line 95, in create_connection
-    raise err
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
-    sock.connect(sa)
-ConnectionRefusedError: [Errno 111] Connection refused
-
-During handling of the above exception, another exception occurred:
-
-Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
-    httplib_response = self._make_request(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 398, in _make_request
-    conn.request(method, url, **httplib_request_kw)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 239, in request
-    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
-  File "/usr/lib/python3.10/http/client.py", line 1283, in request
-    self._send_request(method, url, body, headers, encode_chunked)
-  File "/usr/lib/python3.10/http/client.py", line 1329, in _send_request
-    self.endheaders(body, encode_chunked=encode_chunked)
-  File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders
-    self._send_output(message_body, encode_chunked=encode_chunked)
-  File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output
-    self.send(msg)
-  File "/usr/lib/python3.10/http/client.py", line 976, in send
-    self.connect()
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 205, in connect
-    conn = self._new_conn()
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
-    raise NewConnectionError(
-urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7031c915aec0>: Failed to establish a new connection: [Errno 111] Connection refused
-
-During handling of the above exception, another exception occurred:
-
-Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_embed_metadata_gdrive.py", line 161, in test_convert_file_embed_metadata
-    vals = self.get_convert_book(12)
-  File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 2058, in get_convert_book
-    cls.driver.get(root_url + "/admin/book/"+str(id))
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 449, in get
-    self.execute(Command.GET, {"url": url})
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 438, in execute
-    response = self.command_executor.execute(driver_command, params)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py", line 290, in execute
-    return self._request(command_info[0], url, body=data)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py", line 311, in _request
-    response = self._conn.request(method, url, body=body, headers=headers)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/request.py", line 78, in request
-    return self.request_encode_body(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/request.py", line 170, in request_encode_body
-    return self.urlopen(method, url, **extra_kw)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/poolmanager.py", line 376, in urlopen
-    response = conn.urlopen(method, u.request_uri, **kw)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
-    return self.urlopen(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
-    return self.urlopen(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
-    return self.urlopen(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
-    retries = retries.increment(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
-    raise MaxRetryError(_pool, url, error or ResponseError(cause))
-urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=46827): Max retries exceeded with url: /session/888cc4bf-a51a-48ce-af19-e5699d37f1d8/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7031c915aec0>: Failed to establish a new connection: [Errno 111] Connection refused'))
+ File "/home/ozzie/Development/calibre-web-test/test/test_embed_metadata_gdrive.py", line 183, in test_convert_file_embed_metadata + with zipfile.ZipFile(fs.open(epub_path, "rb")) as thezip: + File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/fs/base.py", line 1228, in open + bin_file = self.openbin(path, mode=bin_mode, buffering=buffering) + File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/fs/googledrivefs/googledrivefs.py", line 438, in openbin + raise ResourceNotFound(path) +fs.errors.ResourceNotFound: resource '/test/Lulu de Marco/book10 (12)/book10 - Lulu de Marco.epub' not found
@@ -5085,71 +6203,13 @@ urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', p
Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
-    conn = connection.create_connection(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/connection.py", line 95, in create_connection
-    raise err
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
-    sock.connect(sa)
-ConnectionRefusedError: [Errno 111] Connection refused
-
-During handling of the above exception, another exception occurred:
-
-Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
-    httplib_response = self._make_request(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 398, in _make_request
-    conn.request(method, url, **httplib_request_kw)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 239, in request
-    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
-  File "/usr/lib/python3.10/http/client.py", line 1283, in request
-    self._send_request(method, url, body, headers, encode_chunked)
-  File "/usr/lib/python3.10/http/client.py", line 1329, in _send_request
-    self.endheaders(body, encode_chunked=encode_chunked)
-  File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders
-    self._send_output(message_body, encode_chunked=encode_chunked)
-  File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output
-    self.send(msg)
-  File "/usr/lib/python3.10/http/client.py", line 976, in send
-    self.connect()
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 205, in connect
-    conn = self._new_conn()
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
-    raise NewConnectionError(
-urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7031c9159cc0>: Failed to establish a new connection: [Errno 111] Connection refused
-
-During handling of the above exception, another exception occurred:
-
-Traceback (most recent call last):
-  File "/home/ozzie/Development/calibre-web-test/test/test_embed_metadata_gdrive.py", line 193, in test_convert_kepub_embed_metadata
-    vals = self.get_convert_book(9)
-  File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 2058, in get_convert_book
-    cls.driver.get(root_url + "/admin/book/"+str(id))
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 449, in get
-    self.execute(Command.GET, {"url": url})
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 438, in execute
-    response = self.command_executor.execute(driver_command, params)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py", line 290, in execute
-    return self._request(command_info[0], url, body=data)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py", line 311, in _request
-    response = self._conn.request(method, url, body=body, headers=headers)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/request.py", line 78, in request
-    return self.request_encode_body(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/request.py", line 170, in request_encode_body
-    return self.urlopen(method, url, **extra_kw)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/poolmanager.py", line 376, in urlopen
-    response = conn.urlopen(method, u.request_uri, **kw)
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
-    return self.urlopen(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
-    return self.urlopen(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
-    return self.urlopen(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
-    retries = retries.increment(
-  File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
-    raise MaxRetryError(_pool, url, error or ResponseError(cause))
-urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=46827): Max retries exceeded with url: /session/888cc4bf-a51a-48ce-af19-e5699d37f1d8/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7031c9159cc0>: Failed to establish a new connection: [Errno 111] Connection refused'))
+ File "/home/ozzie/Development/calibre-web-test/test/test_embed_metadata_gdrive.py", line 214, in test_convert_kepub_embed_metadata + with zipfile.ZipFile(fs.open(epub_path, "rb")) as thezip: + File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/fs/base.py", line 1228, in open + bin_file = self.openbin(path, mode=bin_mode, buffering=buffering) + File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/fs/googledrivefs/googledrivefs.py", line 438, in openbin + raise ResourceNotFound(path) +fs.errors.ResourceNotFound: resource '/test/Sigurd Lindgren/book6 (9)/book6 - Sigurd Lindgren.kepub' not found
@@ -5159,191 +6219,35 @@ urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', p - +
TestEmbedMetadataGdrive - test_download_check_metadata
- -
- ERROR -
- - - - + PASS - +
TestEmbedMetadataGdrive - test_download_kepub_embed_metadata
- ERROR + FAIL
-