[PyKDE] Bug in PyQt4's pyuic for custom widgets
Hans-Peter Jansen
hpj at urpla.net
Thu Jun 15 16:23:40 BST 2006
Am Montag, 12. Juni 2006 12:35 schrieb Andreas Pakulat:
> Hi,
>
> PyQt4's pyuic cannot handle .ui files containing custom widget
> declarations where the header file begins with an h and a directory
> is prepended to it. Something like
>
> <header>widgets/htmlbrowser.h</header>
>
> is translated into following code:
>
> from widgetstmlbrowser import
>
> The attached patch corrects this, by replacing only .h at the end of
> the header string.
+ import re
+ return re.sub(r'\.h$','',header) \
+ .replace("/", ".")
Damn costly to import re for this simple task, fitting the purpose of
endswith() exactly..
Not-dead-just-completely-overloaded-by-getting-father-late-ly yours
Pete
More information about the PyQt
mailing list