img2py script
Anthony Tuininga
anthony.tuininga at gmail.com
Wed Nov 14 10:49:54 PST 2007
Hi everyone. I thought I would ask this question about the img2py
script since it seems to me this would be an improvement -- but
perhaps I'm missing something. :-)
The current script generates fairly ugly code -- which bugs me even
though it doesn't matter since its generated. :-) The generated code
is also quite lengthy thanks to binary data being encoded with four
characters in most cases. Finally the generated code is fairly
intrusive in terms of namespace since three methods are generated for
each image. My suggestion handles all of these, I believe, but I'd
appreciate feedback.
A class could be created (wx.PyImage?) that would encompass the
routines for getting the data, bitmap and image (see attached) which
would clear up the namespace intrusiveness. Then using base64 encoding
dramatically reduces the size of the generated script (see attached
for an example). The names, case, style, etc. are all subject to
change if the concept is accepted, of course.
Comments?
Anthony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: img_class.py
Type: application/x-python
Size: 487 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-dev/attachments/2007111=
4/8b2f6332/img_class.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: img_example.py
Type: application/x-python
Size: 948 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-dev/attachments/2007111=
4/8b2f6332/img_example.bin
More information about the wxpython-dev
mailing list