projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
support for unicode font names
[wxWidgets.git]
/
wxPython
/
wx
/
tools
/
img2py.py
diff --git
a/wxPython/wx/tools/img2py.py
b/wxPython/wx/tools/img2py.py
index bd510ff3e901f1a6e553d2cb0a2f6b9c518e26e4..b4f6b4c9e4ea1b7396f1b8903178364c2d290a27 100644
(file)
--- a/
wxPython/wx/tools/img2py.py
+++ b/
wxPython/wx/tools/img2py.py
@@
-8,6
+8,10
@@
# Copyright: (c) 2002 by Total Control Software
# Licence: wxWindows license
#----------------------------------------------------------------------
# Copyright: (c) 2002 by Total Control Software
# Licence: wxWindows license
#----------------------------------------------------------------------
+# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o V2.5 compatability update
+#
"""
"""
@@
-54,12
+58,23
@@
Options:
# - Cliff Wells <LogiplexSoftware@earthlink.net>
# 20021206: Added catalog (-c) option.
#
# - Cliff Wells <LogiplexSoftware@earthlink.net>
# 20021206: Added catalog (-c) option.
#
+# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o V2.5 compatability update
+#
+
+import cPickle
+import cStringIO
+import getopt
+import glob
+import os
+import sys
+import tempfile
+import zlib
+import wx
-import sys, os, glob, getopt, tempfile
-import cPickle, cStringIO, zlib
-import img2img
-from wxPython import wx
+import img2img
def crunch_data(data, compressed):
def crunch_data(data, compressed):
@@
-116,8
+131,8
@@
def main(args):
return
# some bitmap related things need to have a wxApp initialized...
return
# some bitmap related things need to have a wxApp initialized...
- if wx.
wx
GetApp() is None:
- app = wx.
wx
PySimpleApp()
+ if wx.GetApp() is None:
+ app = wx.PySimpleApp()
append = 0
compressed = 1
append = 0
compressed = 1
@@
-154,7
+169,7
@@
def main(args):
# convert the image file to a temporary file
tfname = tempfile.mktemp()
# convert the image file to a temporary file
tfname = tempfile.mktemp()
- ok, msg = img2img.convert(image_file, maskClr, None, tfname, wx.
wx
BITMAP_TYPE_PNG, ".png")
+ ok, msg = img2img.convert(image_file, maskClr, None, tfname, wx.BITMAP_TYPE_PNG, ".png")
if not ok:
print msg
return
if not ok:
print msg
return
@@
-198,9
+213,9
@@
def main(args):
out.write("#" + "-" * 70 + "\n")
if not append:
out.write("# This file was generated by %s\n#\n" % sys.argv[0])
out.write("#" + "-" * 70 + "\n")
if not append:
out.write("# This file was generated by %s\n#\n" % sys.argv[0])
- out.write("from wx
Python.wx import wxImageFromStream, wx
BitmapFromImage\n")
+ out.write("from wx
import ImageFromStream,
BitmapFromImage\n")
if icon:
if icon:
- out.write("from wx
Python.wx import wx
EmptyIcon\n")
+ out.write("from wx
import
EmptyIcon\n")
if compressed:
out.write("import cStringIO, zlib\n\n\n")
else:
if compressed:
out.write("import cStringIO, zlib\n\n\n")
else:
@@
-222,14
+237,14
@@
def main(args):
out.write("def get%sBitmap():\n"
out.write("def get%sBitmap():\n"
- " return
wx
BitmapFromImage(get%sImage())\n\n"
+ " return BitmapFromImage(get%sImage())\n\n"
"def get%sImage():\n"
" stream = cStringIO.StringIO(get%sData())\n"
"def get%sImage():\n"
" stream = cStringIO.StringIO(get%sData())\n"
- " return
wx
ImageFromStream(stream)\n\n"
+ " return ImageFromStream(stream)\n\n"
% tuple([imgName] * 4))
if icon:
out.write("def get%sIcon():\n"
% tuple([imgName] * 4))
if icon:
out.write("def get%sIcon():\n"
- " icon =
wx
EmptyIcon()\n"
+ " icon = EmptyIcon()\n"
" icon.CopyFromBitmap(get%sBitmap())\n"
" return icon\n\n"
% tuple([imgName] * 2))
" icon.CopyFromBitmap(get%sBitmap())\n"
" return icon\n\n"
% tuple([imgName] * 2))