mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 18:08:42 -05:00
better error messages, update todo
This commit is contained in:
parent
24557b580f
commit
d345f05cdb
3 changed files with 4 additions and 10 deletions
1
todo
1
todo
|
|
@ -1,6 +1,7 @@
|
||||||
==========================================
|
==========================================
|
||||||
todo app wise
|
todo app wise
|
||||||
- errors need to go to standarderror
|
- errors need to go to standarderror
|
||||||
|
- check for optipng, advpng en jpegoptim on load
|
||||||
|
|
||||||
todo else
|
todo else
|
||||||
- figure out dependencies for a .deb/how to make a .deb
|
- figure out dependencies for a .deb/how to make a .deb
|
||||||
|
|
|
||||||
10
trimage.py
10
trimage.py
|
|
@ -12,7 +12,6 @@ from hurry.filesize import *
|
||||||
from ui import Ui_trimage
|
from ui import Ui_trimage
|
||||||
|
|
||||||
VERSION = "1.0"
|
VERSION = "1.0"
|
||||||
DEBUG = True
|
|
||||||
|
|
||||||
#init imagelist
|
#init imagelist
|
||||||
imagelist = []
|
imagelist = []
|
||||||
|
|
@ -75,7 +74,6 @@ class StartQT4(QMainWindow):
|
||||||
parser.add_option("-d", "--directory", action="store", type="string",
|
parser.add_option("-d", "--directory", action="store", type="string",
|
||||||
dest="directory", help="compresses images in directory and exit", )
|
dest="directory", help="compresses images in directory and exit", )
|
||||||
|
|
||||||
|
|
||||||
options, args = parser.parse_args()
|
options, args = parser.parse_args()
|
||||||
|
|
||||||
# send to correct function
|
# send to correct function
|
||||||
|
|
@ -116,7 +114,6 @@ class StartQT4(QMainWindow):
|
||||||
def file_drop(self, images):
|
def file_drop(self, images):
|
||||||
"""Get a file from the drag and drop handler and send it to
|
"""Get a file from the drag and drop handler and send it to
|
||||||
compress_file."""
|
compress_file."""
|
||||||
print images[0]
|
|
||||||
self.delegator(images)
|
self.delegator(images)
|
||||||
|
|
||||||
def file_dialog(self):
|
def file_dialog(self):
|
||||||
|
|
@ -131,9 +128,8 @@ class StartQT4(QMainWindow):
|
||||||
|
|
||||||
def recompress_files(self):
|
def recompress_files(self):
|
||||||
"""Send each file in the current file list to compress_file again."""
|
"""Send each file in the current file list to compress_file again."""
|
||||||
newimagelist = []
|
|
||||||
|
|
||||||
global imagelist
|
global imagelist
|
||||||
|
newimagelist = []
|
||||||
for image in imagelist:
|
for image in imagelist:
|
||||||
newimagelist.append(image[4])
|
newimagelist.append(image[4])
|
||||||
imagelist = []
|
imagelist = []
|
||||||
|
|
@ -153,7 +149,7 @@ class StartQT4(QMainWindow):
|
||||||
imagelist.append(("Compressing...", "", "", "", image,
|
imagelist.append(("Compressing...", "", "", "", image,
|
||||||
QIcon(QPixmap("compressing.gif"))))
|
QIcon(QPixmap("compressing.gif"))))
|
||||||
else:
|
else:
|
||||||
print('[error] %s not an image file' % filename)
|
print('[error] %s not an image file' % image)
|
||||||
self.thread.compress_file(delegatorlist)
|
self.thread.compress_file(delegatorlist)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
@ -272,7 +268,7 @@ class Worker(QThread):
|
||||||
oldfilesizestr = size(oldfilesize, system=alternative)
|
oldfilesizestr = size(oldfilesize, system=alternative)
|
||||||
|
|
||||||
# get extention
|
# get extention
|
||||||
baseName, extention = path.splitext(filename)
|
extention = path.splitext(filename)[1]
|
||||||
|
|
||||||
#decide with tool to use
|
#decide with tool to use
|
||||||
if extention in ['.jpg', '.jpeg']:
|
if extention in ['.jpg', '.jpeg']:
|
||||||
|
|
|
||||||
3
ui.py
3
ui.py
|
|
@ -2,9 +2,6 @@ from PyQt4.QtCore import *
|
||||||
from PyQt4.QtGui import *
|
from PyQt4.QtGui import *
|
||||||
|
|
||||||
|
|
||||||
DEBUG = False
|
|
||||||
|
|
||||||
|
|
||||||
class TrimageTableView(QTableView):
|
class TrimageTableView(QTableView):
|
||||||
"""Init the table drop event."""
|
"""Init the table drop event."""
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue