-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c19b572
commit 82a38d8
Showing
5 changed files
with
34 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
from calibre_plugins.comicalibre.work.main import ComicalibreWork | ||
from PyQt5.Qt import (QCheckBox, QDialog, QFrame, QGroupBox, QHBoxLayout, | ||
QLabel, QLineEdit, QProgressBar, QPushButton, | ||
QVBoxLayout) | ||
QScrollArea, QVBoxLayout) | ||
|
||
__license__ = "GPL v3" | ||
__copyright__ = "2019, Michael Merrill <[email protected]>" | ||
|
@@ -137,8 +137,11 @@ def create_gui(self): | |
self.result_box = QGroupBox() | ||
self.result_box.setTitle("Results") | ||
self.result_text = QLabel("Run Comicalibre to see results.") | ||
self.result_scroll = QScrollArea() | ||
self.result_scroll.setWidget(self.result_text) | ||
self.result_scroll.setWidgetResizable(True) | ||
self.result_layout = QVBoxLayout() | ||
self.result_layout.addWidget(self.result_text) | ||
self.result_layout.addWidget(self.result_scroll) | ||
self.result_box.setLayout(self.result_layout) | ||
self.layout.addWidget(self.result_box) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
from __future__ import (absolute_import, division, print_function, | ||
unicode_literals) | ||
|
||
import sys | ||
import traceback | ||
from threading import Thread | ||
|
||
from calibre_plugins.comicalibre.ui.config import prefs | ||
|
@@ -13,7 +15,7 @@ | |
__copyright__ = "2019, Michael Merrill <[email protected]>" | ||
__docformat__ = "restructuredtext en" | ||
|
||
class ComicalibreWork(Thread): # TODO Should this be a Thread? | ||
class ComicalibreWork(Thread): | ||
""" Control the order of processing for the work being done. """ | ||
errors = [] | ||
|
||
|
@@ -30,6 +32,10 @@ def process(self, progress_bar, process_type, keep_tags): | |
|
||
# Get selected books. | ||
books = self.calibre_worker.get_selected_books() | ||
if (books == -1): | ||
self.errors.append("No selected books.") | ||
return self.errors | ||
|
||
self.prog_worker.calculate_steps(books) | ||
|
||
# Loop through to get all current metadata. | ||
|
@@ -47,10 +53,15 @@ def process(self, progress_bar, process_type, keep_tags): | |
|
||
# Fill metadata from Comic Vine. | ||
try: | ||
self.vine_worker.get_metadata(md, volume_id, issue, process_type == 2) | ||
issue_is_id = process_type == 2 | ||
warn = self.vine_worker.get_metadata(md, volume_id, issue, issue_is_id) | ||
self.errors.extend(warn) | ||
except: | ||
self.errors.append(md.title + id_for_errors + | ||
": Unable to get info from Comic Vine with given IDs.") | ||
traceback.print_exc(file=sys.stdout) | ||
self.prog_worker.iterate() | ||
continue | ||
|
||
self.set_given_metadata(md, keep_tags) | ||
|
||
|
@@ -59,6 +70,9 @@ def process(self, progress_bar, process_type, keep_tags): | |
except: | ||
self.errors.append(md.title + id_for_errors + | ||
": Received data from Comic Vine that was unable to be saved.") | ||
traceback.print_exc(file=sys.stdout) | ||
self.prog_worker.iterate() | ||
continue | ||
|
||
self.prog_worker.iterate() | ||
|
||
|