Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Jul 10, 2018
1 parent 93e6b51 commit a2ffd25
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ before_install:

install:
- 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

script: python3 setup.py build_binary
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ sudo pip3 install --upgrade pillow python-slugify psutil pyqt5 raven
## INPUT FORMATS
**KCC** can understand and convert, at the moment, the following input types:
- Folders containing: PNG, JPG or GIF files
- CBZ, ZIP
- CBR, RAR *(With `unrar` executable)*
- CB7, 7Z *(With `7za` executable)*
- CBZ, ZIP *(With `7z` executable)*
- CBR, RAR *(With `7z` executable)*
- CB7, 7Z *(With `7z` executable)*
- PDF *(Only extracting JPG images)*

## USAGE
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
environment:
PYTHON: "C:\\Python36-x64"
PYTHON: "C:\\Python37-x64"

install:
- 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 -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
- secure-file\tools\secure-file -decrypt other\windows\sentry.py.enc -out kindlecomicconverter\sentry.py -secret %ENCRYPTION%

Expand Down
1 change: 1 addition & 0 deletions kindlecomicconverter/dualmetafix.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
class DualMetaFixException(Exception):
pass


# palm database offset constants
number_of_pdb_records = 76
first_pdb_record = 78
Expand Down
2 changes: 0 additions & 2 deletions kindlecomicconverter/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import os
from xml.dom.minidom import parse, Document
from re import compile
from subprocess import STDOUT, PIPE
from psutil import Popen
from tempfile import mkdtemp
from shutil import rmtree
from . import comicarchive
Expand Down
22 changes: 10 additions & 12 deletions kindlecomicconverter/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
from hashlib import md5
from html.parser import HTMLParser
from distutils.version import StrictVersion
from shutil import rmtree, copy
from tempfile import mkdtemp
from re import split
from traceback import format_tb

Expand All @@ -49,8 +47,7 @@ def error(self, message):
def getImageFileName(imgfile):
name, ext = os.path.splitext(imgfile)
ext = ext.lower()
if name.startswith('.') or (ext != '.png' and ext != '.jpg' and ext != '.jpeg' and ext != '.gif' and
ext != '.webp'):
if name.startswith('.') or ext not in ['.png', '.jpg', '.jpeg', '.gif', '.webp']:
return None
return [name, ext]

Expand Down Expand Up @@ -88,16 +85,17 @@ def md5Checksum(fpath):

def sanitizeTrace(traceback):
return ''.join(format_tb(traceback))\
.replace('C:/projects/kcc/', '') \
.replace('c:/projects/kcc/', '') \
.replace('C:/python36-x64/', '')\
.replace('c:/python36-x64/', '')\
.replace('C:\\projects\\kcc\\', '') \
.replace('c:\\projects\\kcc\\', '') \
.replace('C:\\python36-x64\\', '')\
.replace('c:\\python36-x64\\', '')
.replace('C:/projects/kcc/', '')\
.replace('c:/projects/kcc/', '')\
.replace('C:/python37-x64/', '')\
.replace('c:/python37-x64/', '')\
.replace('C:\\projects\\kcc\\', '')\
.replace('c:\\projects\\kcc\\', '')\
.replace('C:\\python37-x64\\', '')\
.replace('c:\\python37-x64\\', '')


# noinspection PyUnresolvedReferences
def dependencyCheck(level):
missing = []
if level > 2:
Expand Down

0 comments on commit a2ffd25

Please sign in to comment.