From db6423aea9c18d30fe1c1d958e2f83fdbb653cc7 Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Mon, 7 Jan 2013 20:15:17 +0000 Subject: [PATCH] Tweaked CBL tranform to save notes and weblink to comments git-svn-id: http://comictagger.googlecode.com/svn/trunk@293 6c5673fe-1810-88d6-992b-cd32ca31540c --- cbltransformer.py | 9 ++- settings.py | 12 ++-- settingswindow.py | 9 ++- settingswindow.ui | 142 +++++++++++++++++++++++----------------------- 4 files changed, 92 insertions(+), 80 deletions(-) diff --git a/cbltransformer.py b/cbltransformer.py index 66c484d..ac54698 100644 --- a/cbltransformer.py +++ b/cbltransformer.py @@ -75,8 +75,13 @@ class CBLTransformer: if self.settings.copy_locations_to_tags: add_string_list_to_tags( self.metadata.locations ) - if self.settings.copy_notes_to_tags: - append_to_tags_if_unique( self.metadata.notes) + if self.settings.copy_notes_to_comments: + if self.metadata.notes is not None and self.metadata.notes not in self.metadata.comments: + self.metadata.comments += "\n\n" + self.metadata.notes + + if self.settings.copy_weblink_to_comments: + if self.metadata.webLink is not None and self.metadata.webLink not in self.metadata.comments: + self.metadata.comments += "\n\n" + self.metadata.webLink return self.metadata diff --git a/settings.py b/settings.py index 2dc6f28..e939b8c 100644 --- a/settings.py +++ b/settings.py @@ -75,7 +75,8 @@ class ComicTaggerSettings: self.copy_characters_to_tags = False self.copy_teams_to_tags = False self.copy_locations_to_tags = False - self.copy_notes_to_tags = False + self.copy_notes_to_comments = False + self.copy_weblink_to_comments = False self.apply_cbl_transform_on_cv_import = False self.apply_cbl_transform_on_bulk_operation = False @@ -173,8 +174,10 @@ class ComicTaggerSettings: self.copy_teams_to_tags = self.config.getboolean( 'cbl_transform', 'copy_teams_to_tags' ) if self.config.has_option('cbl_transform', 'copy_locations_to_tags'): self.copy_locations_to_tags = self.config.getboolean( 'cbl_transform', 'copy_locations_to_tags' ) - if self.config.has_option('cbl_transform', 'copy_notes_to_tags'): - self.copy_notes_to_tags = self.config.getboolean( 'cbl_transform', 'copy_notes_to_tags' ) + if self.config.has_option('cbl_transform', 'copy_notes_to_comments'): + self.copy_notes_to_comments = self.config.getboolean( 'cbl_transform', 'copy_notes_to_comments' ) + if self.config.has_option('cbl_transform', 'copy_weblink_to_comments'): + self.copy_weblink_to_comments = self.config.getboolean( 'cbl_transform', 'copy_weblink_to_comments' ) if self.config.has_option('cbl_transform', 'apply_cbl_transform_on_cv_import'): self.apply_cbl_transform_on_cv_import = self.config.getboolean( 'cbl_transform', 'apply_cbl_transform_on_cv_import' ) if self.config.has_option('cbl_transform', 'apply_cbl_transform_on_bulk_operation'): @@ -230,7 +233,8 @@ class ComicTaggerSettings: self.config.set( 'cbl_transform', 'copy_characters_to_tags', self.copy_characters_to_tags ) self.config.set( 'cbl_transform', 'copy_teams_to_tags', self.copy_teams_to_tags ) self.config.set( 'cbl_transform', 'copy_locations_to_tags', self.copy_locations_to_tags ) - self.config.set( 'cbl_transform', 'copy_notes_to_tags', self.copy_notes_to_tags ) + self.config.set( 'cbl_transform', 'copy_notes_to_comments', self.copy_notes_to_comments ) + self.config.set( 'cbl_transform', 'copy_weblink_to_comments', self.copy_weblink_to_comments ) self.config.set( 'cbl_transform', 'apply_cbl_transform_on_cv_import', self.apply_cbl_transform_on_cv_import ) self.config.set( 'cbl_transform', 'apply_cbl_transform_on_bulk_operation', self.apply_cbl_transform_on_bulk_operation ) diff --git a/settingswindow.py b/settingswindow.py index 6d539d2..fd9b3c7 100644 --- a/settingswindow.py +++ b/settingswindow.py @@ -128,8 +128,10 @@ class SettingsWindow(QtGui.QDialog): self.cbxCopyTeamsToTags.setCheckState( QtCore.Qt.Checked) if self.settings.copy_locations_to_tags: self.cbxCopyLocationsToTags.setCheckState( QtCore.Qt.Checked) - if self.settings.copy_notes_to_tags: - self.cbxCopyNotesToTags.setCheckState( QtCore.Qt.Checked) + if self.settings.copy_notes_to_comments: + self.cbxCopyNotesToComments.setCheckState( QtCore.Qt.Checked) + if self.settings.copy_weblink_to_comments: + self.cbxCopyWebLinkToComments.setCheckState( QtCore.Qt.Checked) if self.settings.apply_cbl_transform_on_cv_import: self.cbxApplyCBLTransformOnCVIMport.setCheckState( QtCore.Qt.Checked) if self.settings.apply_cbl_transform_on_bulk_operation: @@ -164,7 +166,8 @@ class SettingsWindow(QtGui.QDialog): self.settings.copy_characters_to_tags = self.cbxCopyCharactersToTags.isChecked() self.settings.copy_teams_to_tags = self.cbxCopyTeamsToTags.isChecked() self.settings.copy_locations_to_tags = self.cbxCopyLocationsToTags.isChecked() - self.settings.copy_notes_to_tags = self.cbxCopyNotesToTags.isChecked() + self.settings.copy_notes_to_comments = self.cbxCopyNotesToComments.isChecked() + self.settings.copy_weblink_to_comments = self.cbxCopyWebLinkToComments.isChecked() self.settings.apply_cbl_transform_on_cv_import = self.cbxApplyCBLTransformOnCVIMport.isChecked() self.settings.apply_cbl_transform_on_bulk_operation = self.cbxApplyCBLTransformOnBatchOperation.isChecked() diff --git a/settingswindow.ui b/settingswindow.ui index 5b85bff..7d0abe0 100644 --- a/settingswindow.ui +++ b/settingswindow.ui @@ -6,8 +6,8 @@ 0 0 - 728 - 388 + 674 + 428 @@ -324,10 +324,24 @@ CBL + + + + Apply CBL Transforms on ComicVine Import + + + + + + Apply CBL Transforms on Batch/CLI Operations + + + + - + 0 0 @@ -335,76 +349,62 @@ CBL Transforms - - - - - - - Assume Lone Credit Is Primary - - - - - - - Copy Characters to Generic Tags - - - - - - - Copy Teams to Generic Tags - - - - - - - Copy Locations to Generic Tags - - - - - - - Copy Notes to Generic Tags - - - - - - + + + + 11 + 21 + 242 + 182 + + + + + + + Assume Lone Credit Is Primary + + + + + + + Copy Characters to Generic Tags + + + + + + + Copy Teams to Generic Tags + + + + + + + Copy Locations to Generic Tags + + + + + + + Copy Notes to Comments + + + + + + + Copy Web Link to Comments + + + + + - - - - Apply CBL Transforms on ComicVine Import - - - - - - - Apply CBL Transforms on Batch/CLI Operations - - - - - - - Qt::Vertical - - - - 20 - 40 - - - -