diff --git a/comicinfoxml.py b/comicinfoxml.py index d658d98..0243d67 100644 --- a/comicinfoxml.py +++ b/comicinfoxml.py @@ -271,8 +271,6 @@ class ComicInfoXml: for page in pages_node: metadata.pages.append( page.attrib ) - print metadata.pages - metadata.isEmpty = False return metadata diff --git a/logwindow.py b/logwindow.py new file mode 100644 index 0000000..5bf6cf8 --- /dev/null +++ b/logwindow.py @@ -0,0 +1,38 @@ +""" +A PyQT4 dialog to a text file or log +""" + +""" +Copyright 2012 Anthony Beville + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import sys +from PyQt4 import QtCore, QtGui, uic +import os +from settings import ComicTaggerSettings + + +class LogWindow(QtGui.QDialog): + + + def __init__(self, parent): + super(LogWindow, self).__init__(parent) + + uic.loadUi(os.path.join(ComicTaggerSettings.baseDir(), 'logwindow.ui' ), self) + + + + def setText( self, text ): + self.textEdit.setPlainText( text ) \ No newline at end of file diff --git a/logwindow.ui b/logwindow.ui new file mode 100644 index 0000000..6926d00 --- /dev/null +++ b/logwindow.ui @@ -0,0 +1,78 @@ + + + dialogLog + + + + 0 + 0 + 556 + 287 + + + + Issue Identification Progress + + + + + + + + true + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + true + + + + + + + + + + + buttonBox + accepted() + dialogLog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + dialogLog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/taggerwindow.py b/taggerwindow.py index a67de24..e4600fc 100644 --- a/taggerwindow.py +++ b/taggerwindow.py @@ -25,6 +25,8 @@ from PyQt4.QtCore import QUrl,pyqtSignal import locale import platform import os +import pprint +import json from volumeselectionwindow import VolumeSelectionWindow from options import MetaDataStyle @@ -37,6 +39,7 @@ from settingswindow import SettingsWindow from settings import ComicTaggerSettings from pagebrowser import PageBrowserWindow from filenameparser import FileNameParser +from logwindow import LogWindow import utils import ctversion @@ -163,6 +166,12 @@ class TaggerWindow( QtGui.QMainWindow): self.actionReloadCRTags.setStatusTip( 'Reload ComicRack tags' ) self.actionReloadCRTags.triggered.connect( self.reloadCRTags ) + self.actionViewRawCRTags.setStatusTip( 'View raw ComicRack tag block from file' ) + self.actionViewRawCRTags.triggered.connect( self.viewRawCRTags ) + + self.actionViewRawCBLTags.setStatusTip( 'View raw ComicBookLover tag block from file' ) + self.actionViewRawCBLTags.triggered.connect( self.viewRawCBLTags ) + #self.actionRepackage.setShortcut( ) self.actionRepackage.setStatusTip( 'Re-create archive as CBZ' ) self.actionRepackage.triggered.connect( self.repackageArchive ) @@ -1107,4 +1116,21 @@ class TaggerWindow( QtGui.QMainWindow): def pageBrowserClosed( self ): self.page_browser = None - \ No newline at end of file + + def viewRawCRTags( self ): + if self.comic_archive is not None and self.comic_archive.hasCIX(): + dlg = LogWindow( self ) + dlg.setText( self.comic_archive.readRawCIX() ) + dlg.setWindowTitle( "Raw ComicRack Tag View" ) + dlg.exec_() + + def viewRawCBLTags( self ): + if self.comic_archive is not None and self.comic_archive.hasCBI(): + dlg = LogWindow( self ) + text = pprint.pformat( json.loads(self.comic_archive.readRawCBI()), indent=4 ) + print text + dlg.setText(text ) + dlg.setWindowTitle( "Raw ComicBookLover Tag View" ) + dlg.exec_() + + \ No newline at end of file diff --git a/taggerwindow.ui b/taggerwindow.ui index 15209f6..02a6467 100644 --- a/taggerwindow.ui +++ b/taggerwindow.ui @@ -1035,11 +1035,19 @@ + + + View Raw Tags + + + + - + + @@ -1053,10 +1061,10 @@ Tags + - @@ -1191,6 +1199,16 @@ Show the Page Browser to inspect the comic + + + View Raw ComicRack Tags + + + + + View Raw ComicBookLover Tags + +