mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 10:08:40 -05:00
add preliminary command line support
This commit is contained in:
parent
b5c2d73eec
commit
d6cca21e32
2 changed files with 19 additions and 3 deletions
5
todo
5
todo
|
|
@ -25,7 +25,8 @@ optipng for png and gif, jpegoptim for jpeg. both are available in ubuntu as dep
|
||||||
todo app wise
|
todo app wise
|
||||||
- implement drag and drop on table
|
- implement drag and drop on table
|
||||||
- clean up code, make it PEP-8
|
- clean up code, make it PEP-8
|
||||||
- implement threading (and include advpng then)
|
- implement threading (and include advpng then
|
||||||
|
-
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -39,7 +40,7 @@ hurry.filesize (bundled)
|
||||||
|
|
||||||
optipng 0.6.2.1
|
optipng 0.6.2.1
|
||||||
jpgegoptim 1.2.2
|
jpgegoptim 1.2.2
|
||||||
|
advancecomp 1.15
|
||||||
===========================================
|
===========================================
|
||||||
1.5:
|
1.5:
|
||||||
later versions:
|
later versions:
|
||||||
|
|
|
||||||
17
trimage.py
17
trimage.py
|
|
@ -4,6 +4,7 @@ from PyQt4.QtCore import *
|
||||||
from PyQt4.QtGui import *
|
from PyQt4.QtGui import *
|
||||||
|
|
||||||
from hurry.filesize import *
|
from hurry.filesize import *
|
||||||
|
from optparse import OptionParser
|
||||||
|
|
||||||
from ui import Ui_trimage
|
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.addfiles, SIGNAL("clicked()"), self.file_dialog)
|
||||||
QObject.connect(self.ui.recompress, SIGNAL("clicked()"), self.recompress_files)
|
QObject.connect(self.ui.recompress, SIGNAL("clicked()"), self.recompress_files)
|
||||||
QObject.connect(self.quit_shortcut, SIGNAL("activated()"), qApp, SLOT('quit()'))
|
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):
|
def file_drop(self):
|
||||||
print "booya"
|
print "booya"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue