py2exe support

Usage: setup.py py2exe
You must be able to start trimage.py before even attempting to use py2exe.
It generates a standalone executable.
That standalone exacutable starts up only if the following files can be found on the path: jpegoptim.exe optipng.exe advpng.exe (they must return 0)
Compression does not work yet and the Windows versions of these tools are a lot slower than on Linux. The binaries I found were pretty old. They should most probably be recompiled to make use of new cpu features. Or we should find other tools.

trimage.hurry.filename -> trimage.filename
because py2exe couldn't deal with it
This commit is contained in:
Kálmán Tarnay 2010-04-20 23:29:24 +02:00
parent 464337d033
commit d282bcf8e9
5 changed files with 140 additions and 8 deletions

View file

@ -1,5 +1,11 @@
#!/usr/bin/env python
import sys
win=(sys.platform == "win32")
if win:
import py2exe
sys.path.append("src/trimage")
from distutils.core import setup
setup(name = "trimage",
@ -11,8 +17,7 @@ setup(name = "trimage",
license = "MIT license",
package_dir = {'trimage' : 'src/trimage'},
packages = ["trimage",
"trimage.hurry",
"trimage.hurry.filesize",
"trimage.filesize",
"trimage.ThreadPool",],
package_data = {"trimage" : ["pixmaps/*.*"] },
data_files=[('share/icons/hicolor/scalable/apps', ['desktop/trimage.svg']),
@ -20,4 +25,16 @@ setup(name = "trimage",
scripts = ["trimage"],
long_description = """Trimage is a cross-platform GUI and command-line interface to optimize image files via optipng, advpng and jpegoptim, depending on the filetype (currently, PNG and JPG files are supported). It was inspired by imageoptim. All image files are losslessy compressed on the highest available compression levels. Trimage gives you various input functions to fit your own workflow: A regular file dialog, dragging and dropping and various command line options.""",
requires = ["PyQt4 (>=4.4)"],
#for py2exe
windows=[r'src\trimage\trimage.py'],
zipfile=None,
options={"py2exe":{
"optimize":2,
"compressed":1,
"bundle_files":1,
"includes":["sip",],
"excludes":['email'],
},
},
)