Skip to content

Commit

Permalink
Merge pull request #261 from ciromattia/dev
Browse files Browse the repository at this point in the history
5.4.4
  • Loading branch information
AcidWeb authored Mar 8, 2018
2 parents 7c0b783 + 5ecddac commit 34e2af3
Show file tree
Hide file tree
Showing 25 changed files with 267 additions and 251 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
*.pyc
*.cbz
*.cbr
*.spec
.idea
.DS_Store
.python-version
Thumbs.db
dist
Output
test
solaio
kindlegen*
*.spec
setup.bat
kindlecomicconverter/sentry.py
build/
.python-version
KindleComicConverter.egg-info/
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# CHANGELOG
#### 5.4.4:
* Minor bug fixes

#### 5.4.3:
* Fixed conversion crash on Windows

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ISC LICENSE

Copyright (c) 2012-2014 Ciro Mattia Gonano <[email protected]>
Copyright (c) 2013-2017 Paweł Jastrzębski <[email protected]>
Copyright (c) 2013-2018 Paweł Jastrzębski <[email protected]>

Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,5 @@ The app relies and includes the following scripts:
Please check [wiki page](https://github.com/ciromattia/kcc/wiki/Known-issues).

## COPYRIGHT
Copyright (c) 2012-2017 Ciro Mattia Gonano and Paweł Jastrzębski.
Copyright (c) 2012-2018 Ciro Mattia Gonano and Paweł Jastrzębski.
**KCC** is released under ISC LICENSE; see LICENSE.txt for further details.
4 changes: 1 addition & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ install:
- "%PYTHON%\\python.exe -m pip install -r requirements.txt"
- "%PYTHON%\\python.exe -m pip install certifi PyInstaller"
- nuget install secure-file -ExcludeVersion
- nuget install verpatch -ExcludeVersion
- secure-file\tools\secure-file -decrypt other\windows\Cert.pfx.enc -secret %ENCRYPTION%
- secure-file\tools\secure-file -decrypt other\windows\sentry.py.enc -out kindlecomicconverter\sentry.py -secret %ENCRYPTION%

build_script:
- "%PYTHON%\\python.exe setup.py build_binary"

after_build:
- ps: Get-ChildItem .\dist\KindleComicConverter_win_* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem .\dist\KCC* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }

deploy:
provider: S3
Expand Down
2 changes: 1 addition & 1 deletion kcc-c2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2014 Ciro Mattia Gonano <[email protected]>
# Copyright (c) 2013-2017 Pawel Jastrzebski <[email protected]>
# Copyright (c) 2013-2018 Pawel Jastrzebski <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
Expand Down
2 changes: 1 addition & 1 deletion kcc-c2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2014 Ciro Mattia Gonano <[email protected]>
# Copyright (c) 2013-2017 Pawel Jastrzebski <[email protected]>
# Copyright (c) 2013-2018 Pawel Jastrzebski <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
Expand Down
4 changes: 2 additions & 2 deletions kcc.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "Kindle Comic Converter"
#define MyAppVersion "5.4.3"
#define MyAppVersion "5.4.4"
#define MyAppPublisher "Ciro Mattia Gonano, Paweł Jastrzębski"
#define MyAppURL "http://kcc.iosphe.re/"
#define MyAppExeName "KCC.exe"
Expand All @@ -12,7 +12,7 @@ AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
AppCopyright=Copyright (C) 2012-2017 Ciro Mattia Gonano and Paweł Jastrzębski
AppCopyright=Copyright (C) 2012-2018 Ciro Mattia Gonano and Paweł Jastrzębski
ArchitecturesAllowed=x64
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
Expand Down
22 changes: 2 additions & 20 deletions kcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2014 Ciro Mattia Gonano <[email protected]>
# Copyright (c) 2013-2017 Pawel Jastrzebski <[email protected]>
# Copyright (c) 2013-2018 Pawel Jastrzebski <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
Expand Down Expand Up @@ -34,24 +34,6 @@
else:
os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + '/other/osx/:' + os.environ['PATH']
elif sys.platform.startswith('win'):
'''
import multiprocessing.popen_spawn_win32 as forking
class _Popen(forking.Popen):
def __init__(self, *args, **kw):
if hasattr(sys, 'frozen'):
# noinspection PyUnresolvedReferences,PyProtectedMember
os.putenv('_MEIPASS2', sys._MEIPASS)
try:
super(_Popen, self).__init__(*args, **kw)
finally:
if hasattr(sys, 'frozen'):
if hasattr(os, 'unsetenv'):
os.unsetenv('_MEIPASS2')
else:
os.putenv('_MEIPASS2', '')
forking.Popen = _Popen
'''
if getattr(sys, 'frozen', False):
os.chdir(os.path.dirname(os.path.abspath(sys.executable)))
else:
Expand All @@ -61,7 +43,7 @@ def __init__(self, *args, **kw):
if getattr(sys, 'frozen', False):
try:
import kindlecomicconverter.sentry
except:
except ImportError:
pass

from multiprocessing import freeze_support
Expand Down
22 changes: 11 additions & 11 deletions kindlecomicconverter/KCC_gui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2014 Ciro Mattia Gonano <[email protected]>
# Copyright (c) 2013-2017 Pawel Jastrzebski <[email protected]>
# Copyright (c) 2013-2018 Pawel Jastrzebski <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
Expand Down Expand Up @@ -156,8 +156,8 @@ def run(self):
'(<a href="https://github.com/ciromattia/kcc/releases/">'
'Changelog</a>)', 'warning', False)

def setAnswer(self, dialogAnswer):
self.answer = dialogAnswer
def setAnswer(self, dialoganswer):
self.answer = dialoganswer

def getNewVersion(self):
while self.answer is None:
Expand All @@ -180,8 +180,8 @@ def getNewVersion(self):
MW.hideProgressBar.emit()
MW.modeConvert.emit(1)

def getNewVersionTick(self, size, blockSize, totalSize):
progress = int((size / (totalSize // blockSize)) * 100)
def getNewVersionTick(self, size, blocksize, totalsize):
progress = int((size / (totalsize // blocksize)) * 100)
if size == 0:
MW.progressBarTick.emit('100')
if progress > self.barProgress:
Expand Down Expand Up @@ -667,10 +667,10 @@ def changeDevice(self):
self.addMessage('<a href="https://github.com/ciromattia/kcc/wiki/NonKindle-devices">'
'List of supported Non-Kindle devices.</a>', 'info')

def changeFormat(self, outputFormat=None):
def changeFormat(self, outputformat=None):
profile = GUI.profiles[str(GUI.deviceBox.currentText())]
if outputFormat is not None:
GUI.formatBox.setCurrentIndex(outputFormat)
if outputformat is not None:
GUI.formatBox.setCurrentIndex(outputformat)
else:
GUI.formatBox.setCurrentIndex(profile['DefaultFormat'])
if not GUI.webtoonBox.isChecked():
Expand Down Expand Up @@ -881,10 +881,10 @@ def detectKindleGen(self, startup=False):
else:
self.addMessage('Download it and place executable in /usr/local/bin directory.', 'error')

def __init__(self, KCCAplication, KCCWindow):
def __init__(self, kccapp, kccwindow):
global APP, MW, GUI
APP = KCCAplication
MW = KCCWindow
APP = kccapp
MW = kccwindow
GUI = self
self.setupUi(MW)
self.editor = KCCGUI_MetaEditor()
Expand Down
4 changes: 2 additions & 2 deletions kindlecomicconverter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '5.4.3'
__version__ = '5.4.4'
__license__ = 'ISC'
__copyright__ = '2012-2017, Ciro Mattia Gonano <[email protected]>, Pawel Jastrzebski <[email protected]>'
__copyright__ = '2012-2018, Ciro Mattia Gonano <[email protected]>, Pawel Jastrzebski <[email protected]>'
__docformat__ = 'restructuredtext en'
23 changes: 10 additions & 13 deletions kindlecomicconverter/cbxarchive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2012-2014 Ciro Mattia Gonano <[email protected]>
# Copyright (c) 2013-2017 Pawel Jastrzebski <[email protected]>
# Copyright (c) 2013-2018 Pawel Jastrzebski <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
Expand All @@ -26,13 +26,13 @@


class CBxArchive:
def __init__(self, origFileName):
self.origFileName = origFileName
if is_zipfile(origFileName):
def __init__(self, fname):
self.fname = fname
if is_zipfile(fname):
self.compressor = 'zip'
elif rarfile.is_rarfile(origFileName):
elif rarfile.is_rarfile(fname):
self.compressor = 'rar'
elif is_7zfile(origFileName):
elif is_7zfile(fname):
self.compressor = '7z'
else:
self.compressor = None
Expand All @@ -41,30 +41,27 @@ def isCbxFile(self):
return self.compressor is not None

def extractCBZ(self, targetdir):
cbzFile = ZipFile(self.origFileName)
cbzFile = ZipFile(self.fname)
filelist = []
for f in cbzFile.namelist():
if f.startswith('__MACOSX') or f.endswith('.DS_Store') or f.endswith('humbs.db'):
pass
elif f.endswith('/'):
try:
os.makedirs(os.path.join(targetdir, f))
except Exception:
pass
os.makedirs(os.path.join(targetdir, f), exist_ok=True)
else:
filelist.append(f)
cbzFile.extractall(targetdir, filelist)

def extractCBR(self, targetdir):
cbrFile = rarfile.RarFile(self.origFileName)
cbrFile = rarfile.RarFile(self.fname)
cbrFile.extractall(targetdir)
for root, _, filenames in os.walk(targetdir):
for filename in filenames:
if filename.startswith('__MACOSX') or filename.endswith('.DS_Store') or filename.endswith('humbs.db'):
os.remove(os.path.join(root, filename))

def extractCB7(self, targetdir):
output = Popen('7za x "' + self.origFileName + '" -xr!__MACOSX -xr!.DS_Store -xr!thumbs.db -xr!Thumbs.db -o"' +
output = Popen('7za x "' + self.fname + '" -xr!__MACOSX -xr!.DS_Store -xr!thumbs.db -xr!Thumbs.db -o"' +
targetdir + '"', stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True)
extracted = False
for line in output.stdout:
Expand Down
Loading

0 comments on commit 34e2af3

Please sign in to comment.