Christian Robottom Reis writes:

> I'm still wondering if there's a helper function to convert from raw
> XPM data to pygtk's format, which is a list of strings (without the
> C-ish formatting)..

I'm using the following script that utilizes GNU sed.  It isn't
perfect but works with all the pixmaps I've got.  Maybe you can port
it to Python.

#!/bin/sed -nf
#
# xpmtopy - converts pixmaps into Python lists
#
/\b[a-zA-Z0-9_]\+\b[ ]*\[[ ]*\]/,/};/{
        /};/s/};/]/
        /\b[a-zA-Z0-9_]\+\b[ ]*\[[ ]*\]/{
                s/.*\(\b[a-zA-Z0-9_]\+\b\).*/\1 = [/
        }
        /\[\|".*"\|\]/p
}

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to