mirror of
https://github.com/ciromattia/kcc
synced 2025-12-15 10:46:40 +00:00
Code cleanup
This commit is contained in:
@@ -15,7 +15,7 @@ before_install:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- pip3 install -r requirements.txt
|
- pip3 install -r requirements.txt
|
||||||
- pip3 install certifi https://github.com/bjones1/pyinstaller/archive/pyqt5_fix.zip
|
- pip3 install certifi https://github.com/pyinstaller/pyinstaller/archive/develop.zip
|
||||||
- npm install -g appdmg
|
- npm install -g appdmg
|
||||||
|
|
||||||
script: python3 setup.py build_binary
|
script: python3 setup.py build_binary
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ sudo pip3 install --upgrade pillow python-slugify psutil pyqt5 raven
|
|||||||
## INPUT FORMATS
|
## INPUT FORMATS
|
||||||
**KCC** can understand and convert, at the moment, the following input types:
|
**KCC** can understand and convert, at the moment, the following input types:
|
||||||
- Folders containing: PNG, JPG or GIF files
|
- Folders containing: PNG, JPG or GIF files
|
||||||
- CBZ, ZIP
|
- CBZ, ZIP *(With `7z` executable)*
|
||||||
- CBR, RAR *(With `unrar` executable)*
|
- CBR, RAR *(With `7z` executable)*
|
||||||
- CB7, 7Z *(With `7za` executable)*
|
- CB7, 7Z *(With `7z` executable)*
|
||||||
- PDF *(Only extracting JPG images)*
|
- PDF *(Only extracting JPG images)*
|
||||||
|
|
||||||
## USAGE
|
## USAGE
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
environment:
|
environment:
|
||||||
PYTHON: "C:\\Python36-x64"
|
PYTHON: "C:\\Python37-x64"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- set PATH="%PYTHON%\\Scripts";"C:\\Program Files (x86)\\Inno Setup 5";%PATH%
|
- set PATH="%PYTHON%\\Scripts";"C:\\Program Files (x86)\\Inno Setup 5";%PATH%
|
||||||
- "%PYTHON%\\python.exe -m pip install --upgrade pip setuptools wheel"
|
- "%PYTHON%\\python.exe -m pip install --upgrade pip setuptools wheel"
|
||||||
- "%PYTHON%\\python.exe -m pip install -r requirements.txt"
|
- "%PYTHON%\\python.exe -m pip install -r requirements.txt"
|
||||||
- "%PYTHON%\\python.exe -m pip install certifi https://github.com/bjones1/pyinstaller/archive/pyqt5_fix.zip"
|
- "%PYTHON%\\python.exe -m pip install certifi https://github.com/pyinstaller/pyinstaller/archive/develop.zip"
|
||||||
- nuget install secure-file -ExcludeVersion
|
- nuget install secure-file -ExcludeVersion
|
||||||
- secure-file\tools\secure-file -decrypt other\windows\sentry.py.enc -out kindlecomicconverter\sentry.py -secret %ENCRYPTION%
|
- secure-file\tools\secure-file -decrypt other\windows\sentry.py.enc -out kindlecomicconverter\sentry.py -secret %ENCRYPTION%
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import shutil
|
|||||||
class DualMetaFixException(Exception):
|
class DualMetaFixException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# palm database offset constants
|
# palm database offset constants
|
||||||
number_of_pdb_records = 76
|
number_of_pdb_records = 76
|
||||||
first_pdb_record = 78
|
first_pdb_record = 78
|
||||||
|
|||||||
@@ -19,8 +19,6 @@
|
|||||||
import os
|
import os
|
||||||
from xml.dom.minidom import parse, Document
|
from xml.dom.minidom import parse, Document
|
||||||
from re import compile
|
from re import compile
|
||||||
from subprocess import STDOUT, PIPE
|
|
||||||
from psutil import Popen
|
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
from . import comicarchive
|
from . import comicarchive
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ import os
|
|||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
from html.parser import HTMLParser
|
from html.parser import HTMLParser
|
||||||
from distutils.version import StrictVersion
|
from distutils.version import StrictVersion
|
||||||
from shutil import rmtree, copy
|
|
||||||
from tempfile import mkdtemp
|
|
||||||
from re import split
|
from re import split
|
||||||
from traceback import format_tb
|
from traceback import format_tb
|
||||||
|
|
||||||
@@ -49,8 +47,7 @@ class HTMLStripper(HTMLParser):
|
|||||||
def getImageFileName(imgfile):
|
def getImageFileName(imgfile):
|
||||||
name, ext = os.path.splitext(imgfile)
|
name, ext = os.path.splitext(imgfile)
|
||||||
ext = ext.lower()
|
ext = ext.lower()
|
||||||
if name.startswith('.') or (ext != '.png' and ext != '.jpg' and ext != '.jpeg' and ext != '.gif' and
|
if name.startswith('.') or ext not in ['.png', '.jpg', '.jpeg', '.gif', '.webp']:
|
||||||
ext != '.webp'):
|
|
||||||
return None
|
return None
|
||||||
return [name, ext]
|
return [name, ext]
|
||||||
|
|
||||||
@@ -90,14 +87,15 @@ def sanitizeTrace(traceback):
|
|||||||
return ''.join(format_tb(traceback))\
|
return ''.join(format_tb(traceback))\
|
||||||
.replace('C:/projects/kcc/', '')\
|
.replace('C:/projects/kcc/', '')\
|
||||||
.replace('c:/projects/kcc/', '')\
|
.replace('c:/projects/kcc/', '')\
|
||||||
.replace('C:/python36-x64/', '')\
|
.replace('C:/python37-x64/', '')\
|
||||||
.replace('c:/python36-x64/', '')\
|
.replace('c:/python37-x64/', '')\
|
||||||
.replace('C:\\projects\\kcc\\', '')\
|
.replace('C:\\projects\\kcc\\', '')\
|
||||||
.replace('c:\\projects\\kcc\\', '')\
|
.replace('c:\\projects\\kcc\\', '')\
|
||||||
.replace('C:\\python36-x64\\', '')\
|
.replace('C:\\python37-x64\\', '')\
|
||||||
.replace('c:\\python36-x64\\', '')
|
.replace('c:\\python37-x64\\', '')
|
||||||
|
|
||||||
|
|
||||||
|
# noinspection PyUnresolvedReferences
|
||||||
def dependencyCheck(level):
|
def dependencyCheck(level):
|
||||||
missing = []
|
missing = []
|
||||||
if level > 2:
|
if level > 2:
|
||||||
|
|||||||
Reference in New Issue
Block a user