diff --git a/todo b/todo index f979d01..7929b29 100644 --- a/todo +++ b/todo @@ -1,6 +1,7 @@ ========================================== todo app wise - errors need to go to standarderror +- check for optipng, advpng en jpegoptim on load todo else - figure out dependencies for a .deb/how to make a .deb diff --git a/trimage.py b/trimage.py index ffcb1bd..4a6e856 100644 --- a/trimage.py +++ b/trimage.py @@ -12,7 +12,6 @@ from hurry.filesize import * from ui import Ui_trimage VERSION = "1.0" -DEBUG = True #init imagelist imagelist = [] @@ -75,7 +74,6 @@ class StartQT4(QMainWindow): parser.add_option("-d", "--directory", action="store", type="string", dest="directory", help="compresses images in directory and exit", ) - options, args = parser.parse_args() # send to correct function @@ -116,7 +114,6 @@ class StartQT4(QMainWindow): def file_drop(self, images): """Get a file from the drag and drop handler and send it to compress_file.""" - print images[0] self.delegator(images) def file_dialog(self): @@ -131,9 +128,8 @@ class StartQT4(QMainWindow): def recompress_files(self): """Send each file in the current file list to compress_file again.""" - newimagelist = [] - global imagelist + newimagelist = [] for image in imagelist: newimagelist.append(image[4]) imagelist = [] @@ -153,7 +149,7 @@ class StartQT4(QMainWindow): imagelist.append(("Compressing...", "", "", "", image, QIcon(QPixmap("compressing.gif")))) else: - print('[error] %s not an image file' % filename) + print('[error] %s not an image file' % image) self.thread.compress_file(delegatorlist) """ @@ -272,7 +268,7 @@ class Worker(QThread): oldfilesizestr = size(oldfilesize, system=alternative) # get extention - baseName, extention = path.splitext(filename) + extention = path.splitext(filename)[1] #decide with tool to use if extention in ['.jpg', '.jpeg']: diff --git a/ui.py b/ui.py index e7f73d7..ff1d8da 100644 --- a/ui.py +++ b/ui.py @@ -2,9 +2,6 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * -DEBUG = False - - class TrimageTableView(QTableView): """Init the table drop event.""" def __init__(self, parent=None):