add preliminary command line support

This commit is contained in:
Kilian Valkhof 2010-02-02 18:58:32 +01:00
parent b5c2d73eec
commit d6cca21e32
2 changed files with 19 additions and 3 deletions

5
todo
View file

@ -25,7 +25,8 @@ optipng for png and gif, jpegoptim for jpeg. both are available in ubuntu as dep
todo app wise
- implement drag and drop on table
- clean up code, make it PEP-8
- implement threading (and include advpng then)
- implement threading (and include advpng then
-
todo else
- figure out dependencies for a .deb/how to make a .deb
@ -39,7 +40,7 @@ hurry.filesize (bundled)
optipng 0.6.2.1
jpgegoptim 1.2.2
advancecomp 1.15
===========================================
1.5:
later versions:

View file

@ -4,6 +4,7 @@ from PyQt4.QtCore import *
from PyQt4.QtGui import *
from hurry.filesize import *
from optparse import OptionParser
from ui import Ui_trimage
@ -21,8 +22,22 @@ class StartQT4(QMainWindow):
QObject.connect(self.ui.addfiles, SIGNAL("clicked()"), self.file_dialog)
QObject.connect(self.ui.recompress, SIGNAL("clicked()"), self.recompress_files)
QObject.connect(self.quit_shortcut, SIGNAL("activated()"), qApp, SLOT('quit()'))
QObject.connect(self.ui.processedfiles, SIGNAL("dragEnterEvent()"), self.file_drop)
parser = OptionParser(usage="%prog [-f] [-q] [-d]", version="%prog 1.0")
parser.add_option("-q", "--quiet",
action="store_false", dest="verbose", default=True,
help="don't print status messages to stdout")
parser.add_option("-f", "--file",
action="store", type="string", dest="filename",
help="image to compress")
parser.add_option("-d", "--directory",
action="store", type="string", dest="directory",
help="directory of images to compress")
(options, args) = parser.parse_args()
print options
def file_drop(self):
print "booya"