]> git.saurik.com Git - wxWidgets.git/blame - wxPython/wx/tools/XRCed/encode_bitmaps.py
Use unbuffered output
[wxWidgets.git] / wxPython / wx / tools / XRCed / encode_bitmaps.py
CommitLineData
1fded56b 1
d14a1e28
RD
2import sys, os, glob
3from wxPython.tools import img2py
4
5output = 'images.py'
6
7# get the list of PNG files
8files = glob.glob('src-images/*.png')
9
10# Truncate the inages module
11open(output, 'w')
12
13# call img2py on each file
14for file in files:
15
16 # extract the basename to be used as the image name
17 name = os.path.splitext(os.path.basename(file))[0]
18
19 # encode it
20 if file == files[0]:
21 cmd = "-u -i -n %s %s %s" % (name, file, output)
22 else:
23 cmd = "-a -u -i -n %s %s %s" % (name, file, output)
24 img2py.main(cmd.split())
25
26
1fded56b 27