# Copyright: (c) 2002 by Total Control Software
# Licence: wxWindows license
#----------------------------------------------------------------------
+# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o V2.5 compatability update
+#
"""
# - 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):
return fp.getvalue()
-
+app = None
def main(args):
if not args or ("-h" in args):
print __doc__
return
# some bitmap related things need to have a wxApp initialized...
- if wx.wxGetApp() is None:
- app = wx.wxPySimpleApp()
+ if wx.GetApp() is None:
+ global app
+ app = wx.PySimpleApp()
append = 0
compressed = 1
# convert the image file to a temporary file
tfname = tempfile.mktemp()
- ok, msg = img2img.convert(image_file, maskClr, None, tfname, wx.wxBITMAP_TYPE_PNG, ".png")
+ ok, msg = img2img.convert(image_file, maskClr, None, tfname, wx.BITMAP_TYPE_PNG, ".png")
if not ok:
print msg
return
out.write("#" + "-" * 70 + "\n")
if not append:
out.write("# This file was generated by %s\n#\n" % sys.argv[0])
- out.write("from wxPython.wx import wxImageFromStream, wxBitmapFromImage\n")
+ out.write("from wx import ImageFromStream, BitmapFromImage\n")
if icon:
- out.write("from wxPython.wx import wxEmptyIcon\n")
+ out.write("from wx import EmptyIcon\n")
if compressed:
out.write("import cStringIO, zlib\n\n\n")
else:
out.write("def get%sBitmap():\n"
- " return wxBitmapFromImage(get%sImage())\n\n"
+ " return BitmapFromImage(get%sImage())\n\n"
"def get%sImage():\n"
" stream = cStringIO.StringIO(get%sData())\n"
- " return wxImageFromStream(stream)\n\n"
+ " return ImageFromStream(stream)\n\n"
% tuple([imgName] * 4))
if icon:
out.write("def get%sIcon():\n"
- " icon = wxEmptyIcon()\n"
+ " icon = EmptyIcon()\n"
" icon.CopyFromBitmap(get%sBitmap())\n"
" return icon\n\n"
% tuple([imgName] * 2))