| 1 |
# Make Win32 executable for OpenDict |
|---|
| 2 |
|
|---|
| 3 |
import os |
|---|
| 4 |
import sys |
|---|
| 5 |
|
|---|
| 6 |
#sys.path = [os.path.join(os.curdir, "lib")] + sys.path |
|---|
| 7 |
sys.path = ["C:\\Program files\\OpenDict-dev\Opendict-source\lib"] + sys.path |
|---|
| 8 |
|
|---|
| 9 |
odlist = "wx.Python.html,shutil,zipfile,string," |
|---|
| 10 |
|
|---|
| 11 |
list = "encodings,codecs,xml,ConfigParser,"\ |
|---|
| 12 |
"Cookie,copy,ftplib,glob,gopherlib,gzip,htmllib,HTMLParser,httplib,"\ |
|---|
| 13 |
"locale,re,sgmllib,socket,stat,StringIO,threading,thread,"\ |
|---|
| 14 |
"urllib,urllib2,urlparse,uu,warnings,webbrowser" |
|---|
| 15 |
|
|---|
| 16 |
command = "C:\\python24\\python.exe setup.py py2exe -w " \ |
|---|
| 17 |
"--icon ..\\pixmaps\\icon.ico -i %s " \ |
|---|
| 18 |
"--packages encodings --force-imports encodings" % (odlist+list) |
|---|
| 19 |
#command = "C:\\python22\\python.exe setup.py py2exe --icon ..\\pixmaps\\icon.ico" |
|---|
| 20 |
print "Command: '%s'\n" % command |
|---|
| 21 |
|
|---|
| 22 |
out = os.popen(command) |
|---|
| 23 |
|
|---|
| 24 |
print "\"dist\" directory will be created." |
|---|
| 25 |
print "Compiling, will take a minute...\n", out.read() |
|---|
| 26 |
|
|---|
| 27 |
raw_input("<Enter>...") |
|---|