mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 10:08:40 -05:00
update todo, pep8 changes
This commit is contained in:
parent
8a89a44c9e
commit
45410e7b4b
2 changed files with 14 additions and 9 deletions
|
|
@ -5,12 +5,17 @@ todo app wise
|
||||||
any random part of code (can leave things in a mess)
|
any random part of code (can leave things in a mess)
|
||||||
- consider context managers for handling compression, so as to keep operations
|
- consider context managers for handling compression, so as to keep operations
|
||||||
atomic and/or rollback-able
|
atomic and/or rollback-able
|
||||||
|
|
||||||
- add a recursive option on the command-line for use with -d
|
- add a recursive option on the command-line for use with -d
|
||||||
- make -f accept a list of files
|
- make -f accept a list of files
|
||||||
- make the current verbose be "normal", and make -verbose print the commandline
|
- make the current verbose be "normal", and make -verbose print the commandline
|
||||||
app prints as well
|
app prints as well
|
||||||
|
|
||||||
- verify that a *recompressed* file is smaller than the compressed one
|
- verify that a *recompressed* file is smaller than the compressed one
|
||||||
- find a way to specify the version once for everywhere
|
- find a way to specify the version once for everywhere
|
||||||
|
- notification area drag/drop widget
|
||||||
|
- save chosen directory and geometry/screen position using QSettings
|
||||||
|
|
||||||
|
|
||||||
todo else
|
todo else
|
||||||
- figure out how to make mac and win versions (someone else :) <- via gui2exe
|
- figure out how to make mac and win versions (someone else :) <- via gui2exe
|
||||||
|
|
@ -22,7 +27,6 @@ later versions:
|
||||||
punypng api? http://www.gracepointafterfive.com/punypng/api
|
punypng api? http://www.gracepointafterfive.com/punypng/api
|
||||||
imagemagick/graphicsmagick?
|
imagemagick/graphicsmagick?
|
||||||
always on top option
|
always on top option
|
||||||
notification area widget
|
|
||||||
intelligently recompress, i.e. go through the list of files, recompress
|
intelligently recompress, i.e. go through the list of files, recompress
|
||||||
each until no more gains are seen (and a sensible number-of-tries limit
|
each until no more gains are seen (and a sensible number-of-tries limit
|
||||||
isn't exceeded), and flag that file as fully-optimised. Repeat for each
|
isn't exceeded), and flag that file as fully-optimised. Repeat for each
|
||||||
|
|
|
||||||
|
|
@ -215,19 +215,19 @@ class StartQT4(QMainWindow):
|
||||||
|
|
||||||
def checkapps(self):
|
def checkapps(self):
|
||||||
"""Check if the required command line apps exist."""
|
"""Check if the required command line apps exist."""
|
||||||
exe=".exe" if (sys.platform=="win32") else ""
|
exe = ".exe" if (sys.platform == "win32") else ""
|
||||||
status = False
|
status = False
|
||||||
retcode = self.safe_call("jpegoptim"+exe+" --version")
|
retcode = self.safe_call("jpegoptim" + exe + " --version")
|
||||||
if retcode != 0:
|
if retcode != 0:
|
||||||
status = True
|
status = True
|
||||||
sys.stderr.write("[error] please install jpegoptim")
|
sys.stderr.write("[error] please install jpegoptim")
|
||||||
|
|
||||||
retcode = self.safe_call("optipng"+exe+" -v")
|
retcode = self.safe_call("optipng" + exe + " -v")
|
||||||
if retcode != 0:
|
if retcode != 0:
|
||||||
status = True
|
status = True
|
||||||
sys.stderr.write("[error] please install optipng")
|
sys.stderr.write("[error] please install optipng")
|
||||||
|
|
||||||
retcode = self.safe_call("advpng"+exe+" --version")
|
retcode = self.safe_call("advpng" + exe + " --version")
|
||||||
if retcode != 0:
|
if retcode != 0:
|
||||||
status = True
|
status = True
|
||||||
sys.stderr.write("[error] please install advancecomp")
|
sys.stderr.write("[error] please install advancecomp")
|
||||||
|
|
@ -252,6 +252,7 @@ class StartQT4(QMainWindow):
|
||||||
self.show()
|
self.show()
|
||||||
self.systemtray.hideMain.setText("&Hide window")
|
self.systemtray.hideMain.setText("&Hide window")
|
||||||
|
|
||||||
|
|
||||||
class TriTableModel(QAbstractTableModel):
|
class TriTableModel(QAbstractTableModel):
|
||||||
|
|
||||||
def __init__(self, parent, imagelist, header, *args):
|
def __init__(self, parent, imagelist, header, *args):
|
||||||
|
|
@ -372,11 +373,11 @@ class Image:
|
||||||
raise "Tried to compress invalid image (unsupported format or not \
|
raise "Tried to compress invalid image (unsupported format or not \
|
||||||
file)"
|
file)"
|
||||||
self.reset()
|
self.reset()
|
||||||
self.compressing=True
|
self.compressing = True
|
||||||
exe=".exe" if (sys.platform=="win32") else ""
|
exe = ".exe" if (sys.platform == "win32") else ""
|
||||||
runString = {
|
runString = {
|
||||||
"jpeg": u"jpegoptim"+exe+" -f --strip-all '%(file)s'",
|
"jpeg": u"jpegoptim" + exe + " -f --strip-all '%(file)s'",
|
||||||
"png" : u"optipng"+exe+" -force -o7 '%(file)s'&&advpng"+exe+" -z4 '%(file)s'"}
|
"png": u"optipng" + exe + " -force -o7 '%(file)s'&&advpng" + exe + " -z4 '%(file)s'"}
|
||||||
try:
|
try:
|
||||||
retcode = call(runString[self.filetype] % {"file": self.fullpath},
|
retcode = call(runString[self.filetype] % {"file": self.fullpath},
|
||||||
shell=True, stdout=PIPE)
|
shell=True, stdout=PIPE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue