1
0
mirror of https://github.com/ciromattia/kcc synced 2026-05-31 03:33:16 +00:00

Code cleanup

This commit is contained in:
Paweł Jastrzębski
2018-07-10 09:00:13 +02:00
parent 93e6b51466
commit a2ffd259b8
6 changed files with 17 additions and 20 deletions
+10 -12
View File
@@ -22,8 +22,6 @@ import os
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
@@ -49,8 +47,7 @@ class HTMLStripper(HTMLParser):
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]
@@ -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: