From 8e5704683c43ed5e9ab02de87afc16ea3ec183b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 4 Aug 2015 09:54:39 +0200 Subject: [PATCH 1/8] Fixed detection of file corruption --- kcc/comic2ebook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 06a1c61..ce4cfa6 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -986,7 +986,7 @@ def detectCorruption(tmpPath, orgPath): imageSmaller += 1 except Exception as err: rmtree(os.path.join(tmpPath, '..', '..'), True) - if 'decoder' in err and 'not available' in err: + if 'decoder' in str(err) and 'not available' in str(err): raise RuntimeError('Pillow was compiled without JPG and/or PNG decoder.') else: raise RuntimeError('Image file %s is corrupted.' % pathOrg) From 370c9d4df7e0abb670db57c2a6271512fda3b874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Sun, 9 Aug 2015 10:08:24 +0200 Subject: [PATCH 2/8] Tweaked setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 64774e5..95b712c 100755 --- a/setup.py +++ b/setup.py @@ -95,7 +95,7 @@ elif platform == 'win32': zipfile=None, data_files=additional_files) else: - if argv[1] == 'make_pyz': + if len(argv) > 1 and argv[1] == 'make_pyz': from os import system script = ''' cp kcc.py __main__.py From e861e7f6e8bd42a302144721b7b352d5150fe6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Mon, 24 Aug 2015 17:07:49 +0200 Subject: [PATCH 3/8] Updated page endpoints --- kcc/KCC_gui.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index a020cf2..038d050 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -245,22 +245,22 @@ class VersionThread(QtCore.QThread): def run(self): try: - XML = urlopen('http://kcc.iosphe.re/Version.php') + XML = urlopen('https://kcc.iosphe.re/Version/') XML = parse(XML) except Exception: return - latestVersion = XML.childNodes[0].getElementsByTagName('latest')[0].childNodes[0].toxml() + latestVersion = XML.childNodes[0].getElementsByTagName('LatestVersion')[0].childNodes[0].toxml() if StrictVersion(latestVersion) > StrictVersion(__version__): if sys.platform.startswith('win'): self.newVersion = latestVersion - self.md5 = XML.childNodes[0].getElementsByTagName('WindowsMD5')[0].childNodes[0].toxml() + self.md5 = XML.childNodes[0].getElementsByTagName('MD5')[0].childNodes[0].toxml() MW.showDialog.emit('New version released! ' 'See changelog.

Installed version: ' + __version__ + '
Current version: ' + latestVersion + '

Would you like to start automatic update?', 'question') self.getNewVersion() else: - MW.addMessage.emit('' + MW.addMessage.emit('' 'New version is available! ' '(' 'Changelog)', 'warning', False) @@ -275,7 +275,7 @@ class VersionThread(QtCore.QThread): try: MW.modeConvert.emit(-1) MW.progressBarTick.emit('Downloading update') - path = urlretrieve('http://kcc.iosphe.re/Windows/KindleComicConverter_win_' + path = urlretrieve('https://kcc.iosphe.re/Windows/KindleComicConverter_win_' + self.newVersion + '.exe', reporthook=self.getNewVersionTick) if self.md5 != md5Checksum(path[0]): raise Exception @@ -1205,7 +1205,7 @@ class KCCGUI(KCC_ui.Ui_KCC): "Kindle DX/DXG", ] - statusBarLabel = QtWidgets.QLabel('HOMEPAGE - HOMEPAGE - DO' 'NATE - WIKI - FORUM') From 351084b7036e006ef654c2925208a014786b7da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Mon, 24 Aug 2015 17:11:35 +0200 Subject: [PATCH 4/8] Implemented error reporting --- kcc/KCC_gui.py | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index 038d050..d37aa25 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -20,16 +20,17 @@ import os import sys from urllib.parse import unquote -from urllib.request import urlopen, urlretrieve +from urllib.request import urlopen, urlretrieve, Request from socket import gethostbyname_ex, gethostname from traceback import format_tb -from time import sleep +from time import sleep, time +from datetime import datetime from shutil import move from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn from subprocess import STDOUT, PIPE from PyQt5 import QtGui, QtCore, QtWidgets, QtNetwork -from xml.dom.minidom import parse +from xml.dom.minidom import parse, Document from psutil import Popen, Process from copy import copy from distutils.version import StrictVersion @@ -350,7 +351,7 @@ class WorkerThread(QtCore.QThread): def sanitizeTrace(self, traceback): return ''.join(format_tb(traceback))\ - .replace('C:\\Users\\AcidWeb\\Documents\\Projekty\\KCC\\', '')\ + .replace('C:\\Users\\pawel\\Documents\\Projekty\\KCC\\', '')\ .replace('C:\\Python34\\', '')\ .replace('C:\\Python34_64\\', '') @@ -928,6 +929,30 @@ class KCCGUI(KCC_ui.Ui_KCC): def showDialog(self, message, kind): if kind == 'error': QtWidgets.QMessageBox.critical(MW, 'KCC - Error', message, QtWidgets.QMessageBox.Ok) + try: + doc = Document() + root = doc.createElement('KCCErrorReport') + doc.appendChild(root) + main = doc.createElement('Timestamp') + root.appendChild(main) + text = doc.createTextNode(datetime.fromtimestamp(time()).strftime('%Y-%m-%d %H:%M:%S')) + main.appendChild(text) + main = doc.createElement('OS') + root.appendChild(main) + text = doc.createTextNode(sys.platform) + main.appendChild(text) + main = doc.createElement('Version') + root.appendChild(main) + text = doc.createTextNode(__version__) + main.appendChild(text) + main = doc.createElement('Error') + root.appendChild(main) + text = doc.createTextNode(message) + main.appendChild(text) + urlopen(Request(url='https://kcc.iosphe.re/ErrorHandle/', data=doc.toxml(encoding='utf-8'), + headers={'Content-Type': 'application/xml'})) + except: + pass elif kind == 'question': GUI.versionCheck.setAnswer(QtWidgets.QMessageBox.question(MW, 'KCC - Question', message, QtWidgets.QMessageBox.Yes, From d26eb7cdcdbb7a5e90465e7612ec46c8beb35eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Mon, 24 Aug 2015 17:18:39 +0200 Subject: [PATCH 5/8] Set proper User-Agent --- kcc/KCC_gui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index d37aa25..8d403f0 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -246,8 +246,8 @@ class VersionThread(QtCore.QThread): def run(self): try: - XML = urlopen('https://kcc.iosphe.re/Version/') - XML = parse(XML) + XML = parse(urlopen(Request('https://kcc.iosphe.re/Version/', + headers={'User-Agent': 'KindleComicConverter/' + __version__}))) except Exception: return latestVersion = XML.childNodes[0].getElementsByTagName('LatestVersion')[0].childNodes[0].toxml() @@ -950,7 +950,8 @@ class KCCGUI(KCC_ui.Ui_KCC): text = doc.createTextNode(message) main.appendChild(text) urlopen(Request(url='https://kcc.iosphe.re/ErrorHandle/', data=doc.toxml(encoding='utf-8'), - headers={'Content-Type': 'application/xml'})) + headers={'Content-Type': 'application/xml', + 'User-Agent': 'KindleComicConverter/' + __version__})) except: pass elif kind == 'question': From c991feb9ce36fa5ef710d5b0a857b7e8a205998e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 28 Aug 2015 19:33:40 +0200 Subject: [PATCH 6/8] GUI tweaks --- gui/KCC-OSX.ui | 6 ++++++ gui/KCC.ui | 6 ++++++ gui/MetaEditor-OSX.ui | 3 +++ kcc/KCC_MetaEditor_ui_osx.py | 1 + kcc/KCC_gui.py | 6 ++++++ kcc/KCC_ui.py | 2 ++ kcc/KCC_ui_osx.py | 2 ++ 7 files changed, 26 insertions(+) diff --git a/gui/KCC-OSX.ui b/gui/KCC-OSX.ui index 19768ee..7000969 100644 --- a/gui/KCC-OSX.ui +++ b/gui/KCC-OSX.ui @@ -462,6 +462,12 @@ QAbstractItemView::NoSelection + + QAbstractItemView::ScrollPerPixel + + + QAbstractItemView::ScrollPerPixel + diff --git a/gui/KCC.ui b/gui/KCC.ui index 4cd08dc..67153f9 100644 --- a/gui/KCC.ui +++ b/gui/KCC.ui @@ -397,6 +397,12 @@ QAbstractItemView::NoSelection + + QAbstractItemView::ScrollPerPixel + + + QAbstractItemView::ScrollPerPixel + diff --git a/gui/MetaEditor-OSX.ui b/gui/MetaEditor-OSX.ui index 681e1c0..a81cacb 100644 --- a/gui/MetaEditor-OSX.ui +++ b/gui/MetaEditor-OSX.ui @@ -126,6 +126,9 @@ + + QFormLayout::ExpandingFieldsGrow + diff --git a/kcc/KCC_MetaEditor_ui_osx.py b/kcc/KCC_MetaEditor_ui_osx.py index 3bcf74d..8561c55 100644 --- a/kcc/KCC_MetaEditor_ui_osx.py +++ b/kcc/KCC_MetaEditor_ui_osx.py @@ -76,6 +76,7 @@ class Ui_MetaEditorDialog(object): self.formLayoutWidget.setObjectName("formLayoutWidget") self.formLayout = QtWidgets.QFormLayout(self.formLayoutWidget) self.formLayout.setContentsMargins(0, 0, 0, 0) + self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.ExpandingFieldsGrow) self.formLayout.setObjectName("formLayout") self.label = QtWidgets.QLabel(self.formLayoutWidget) self.label.setObjectName("label") diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index 8d403f0..a8a7fb3 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -1333,6 +1333,12 @@ class KCCGUI(KCC_ui.Ui_KCC): self.versionCheck.start() self.contentServer.start() self.tray.show() + + # Linux hack as PyQt 5.5 not hit mainstream distributions yet + if sys.platform.startswith('linux') and StrictVersion(QtCore.qVersion()) > StrictVersion('5.4.9'): + self.JobList.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) + self.JobList.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) + MW.setWindowTitle("Kindle Comic Converter " + __version__) MW.show() MW.raise_() diff --git a/kcc/KCC_ui.py b/kcc/KCC_ui.py index 35d5ca8..a80e9bf 100644 --- a/kcc/KCC_ui.py +++ b/kcc/KCC_ui.py @@ -141,6 +141,8 @@ class Ui_KCC(object): self.JobList.setStyleSheet("QListWidget#JobList {background:#ffffff;background-image:url(:/Other/icons/list_background.png);background-position:center center;background-repeat:no-repeat;}QScrollBar:vertical{border:1px solid #999;background:#FFF;width:5px;margin:0}QScrollBar::handle:vertical{background:DarkGray;min-height:0}QScrollBar::add-line:vertical{height:0;background:DarkGray;subcontrol-position:bottom;subcontrol-origin:margin}QScrollBar::sub-line:vertical{height:0;background:DarkGray;subcontrol-position:top;subcontrol-origin:margin}QScrollBar:horizontal{border:1px solid #999;background:#FFF;height:5px;margin:0}QScrollBar::handle:horizontal{background:DarkGray;min-width:0}QScrollBar::add-line:horizontal{width:0;background:DarkGray;subcontrol-position:bottom;subcontrol-origin:margin}QScrollBar::sub-line:horizontal{width:0;background:DarkGray;subcontrol-position:top;subcontrol-origin:margin}") self.JobList.setProperty("showDropIndicator", False) self.JobList.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection) + self.JobList.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) + self.JobList.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) self.JobList.setObjectName("JobList") self.BasicModeButton = QtWidgets.QPushButton(self.Form) self.BasicModeButton.setGeometry(QtCore.QRect(10, 10, 141, 32)) diff --git a/kcc/KCC_ui_osx.py b/kcc/KCC_ui_osx.py index 6184b04..55f1a19 100644 --- a/kcc/KCC_ui_osx.py +++ b/kcc/KCC_ui_osx.py @@ -188,6 +188,8 @@ class Ui_KCC(object): self.JobList.setStyleSheet("QListWidget#JobList {background:#ffffff;background-image:url(:/Other/icons/list_background.png);background-position:center center;background-repeat:no-repeat;}QScrollBar:vertical{border:1px solid #999;background:#FFF;width:5px;margin:0}QScrollBar::handle:vertical{background:DarkGray;min-height:0}QScrollBar::add-line:vertical{height:0;background:DarkGray;subcontrol-position:bottom;subcontrol-origin:margin}QScrollBar::sub-line:vertical{height:0;background:DarkGray;subcontrol-position:top;subcontrol-origin:margin}QScrollBar:horizontal{border:1px solid #999;background:#FFF;height:5px;margin:0}QScrollBar::handle:horizontal{background:DarkGray;min-width:0}QScrollBar::add-line:horizontal{width:0;background:DarkGray;subcontrol-position:bottom;subcontrol-origin:margin}QScrollBar::sub-line:horizontal{width:0;background:DarkGray;subcontrol-position:top;subcontrol-origin:margin}") self.JobList.setProperty("showDropIndicator", False) self.JobList.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection) + self.JobList.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) + self.JobList.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) self.JobList.setObjectName("JobList") self.BasicModeButton = QtWidgets.QPushButton(self.Form) self.BasicModeButton.setGeometry(QtCore.QRect(5, 10, 156, 41)) From 10386d8af3c512bcb15215deb93d3e5d93b2b6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 28 Aug 2015 19:50:43 +0200 Subject: [PATCH 7/8] Added detailed platform info to error report --- kcc/KCC_gui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index a8a7fb3..e5948e9 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -35,6 +35,7 @@ from psutil import Popen, Process from copy import copy from distutils.version import StrictVersion from xml.sax.saxutils import escape +from platform import platform from .shared import md5Checksum, HTMLStripper from . import __version__ from . import comic2ebook @@ -939,7 +940,7 @@ class KCCGUI(KCC_ui.Ui_KCC): main.appendChild(text) main = doc.createElement('OS') root.appendChild(main) - text = doc.createTextNode(sys.platform) + text = doc.createTextNode(platform()) main.appendChild(text) main = doc.createElement('Version') root.appendChild(main) From cad05904f3a0fe2da8e45a50ebdf84724a7d0c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 28 Aug 2015 19:51:16 +0200 Subject: [PATCH 8/8] Updated README + version bump --- README.md | 12 ++++++++++++ kcc.iss | 2 +- kcc/__init__.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 696c553..5b88121 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,10 @@ The app relies and includes the following scripts: * [Kobo Aura H2O](http://kcc.iosphe.re/Samples/Ubunchu-KoAH2O.kepub.epub) ## CHANGELOG +####4.6.3: +* Implemented remote bug reporting +* Minor bug fixes and GUI tweaks + ####4.6.2: * Fixed critical MOBI header bug * Fixed metadata encoding error @@ -423,6 +427,14 @@ The app relies and includes the following scripts: ####1.0 * Initial version +## PRIVACY +**KCC** is initiating internet connections in three cases: +* During startup - Version check +* When MCD metadata are used - Cover download +* When error occurs - Automatic reporting + +Error report include **KCC** version, OS version and content of error message. + ## KNOWN ISSUES Please check [wiki page](https://github.com/ciromattia/kcc/wiki/Known-issues). diff --git a/kcc.iss b/kcc.iss index 5deb343..d4e88fe 100644 --- a/kcc.iss +++ b/kcc.iss @@ -1,5 +1,5 @@ #define MyAppName "Kindle Comic Converter" -#define MyAppVersion "4.6.2" +#define MyAppVersion "4.6.3" #define MyAppPublisher "Ciro Mattia Gonano, Paweł Jastrzębski" #define MyAppURL "http://kcc.iosphe.re/" #define MyAppExeName "KCC.exe" diff --git a/kcc/__init__.py b/kcc/__init__.py index 10c7f42..559ed65 100644 --- a/kcc/__init__.py +++ b/kcc/__init__.py @@ -1,4 +1,4 @@ -__version__ = '4.6.2' +__version__ = '4.6.3' __license__ = 'ISC' __copyright__ = '2012-2015, Ciro Mattia Gonano , Pawel Jastrzebski ' __docformat__ = 'restructuredtext en'