-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #261 from ciromattia/dev
5.4.4
- Loading branch information
Showing
25 changed files
with
267 additions
and
251 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
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/ |
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,4 +1,7 @@ | ||
# CHANGELOG | ||
#### 5.4.4: | ||
* Minor bug fixes | ||
|
||
#### 5.4.3: | ||
* Fixed conversion crash on Windows | ||
|
||
|
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,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 | ||
|
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 |
---|---|---|
|
@@ -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 | ||
|
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 |
---|---|---|
|
@@ -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 | ||
|
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 |
---|---|---|
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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 | ||
|
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,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 | ||
|
@@ -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: | ||
|
@@ -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: | ||
|
@@ -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(): | ||
|
@@ -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() | ||
|
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,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' |
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,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 | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
Oops, something went wrong.