Bug 217537 - pykdeuic4 doesn't work with PyQt 4.6.2
Summary: pykdeuic4 doesn't work with PyQt 4.6.2
Status: RESOLVED FIXED
Alias: None
Product: bindings
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kde-bindings
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-06 09:20 UTC by Michael Donaghy
Modified: 2009-12-21 20:22 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Donaghy 2009-12-06 09:20:17 UTC
Version:            (using KDE 4.3.4)
Compiler:          gcc (Gentoo 4.4.2 p1.0) 4.4.2 
OS:                Linux
Installed from:    Gentoo Packages

When I try and build a project that uses pykdeuic4, it fails with an error like the following:
md401@arcueid ~/pants/sakusen $ make -C kiai
make: Entering directory `/home/md401/pants/sakusen/kiai'
pykdeuic4 -o connectDialog.py ../kiai/connectDialog.ui
Traceback (most recent call last):
  File "/usr/bin/pykdeuic4", line 148, in <module>
    main()
  File "/usr/bin/pykdeuic4", line 145, in main
    processUI(args[0], output_filename, exe)
  File "/usr/bin/pykdeuic4", line 74, in processUI
    winfo = comp.compileUi(uifile, output)
  File "/usr/lib64/python2.6/site-packages/PyQt4/uic/Compiler/compiler.py", line 66, in compileUi
    w = self.parse(input_stream)
  File "/usr/lib64/python2.6/site-packages/PyQt4/uic/uiparser.py", line 777, in parse
    actor(elem)
  File "/usr/lib64/python2.6/site-packages/PyQt4/uic/uiparser.py", line 623, in createUserInterface
    self.wprops.setProperties(self.toplevelWidget, elem)
  File "/usr/lib64/python2.6/site-packages/PyQt4/uic/properties.py", line 271, in setProperties
    getattr(widget, "set%s%s" % (ascii_upper(propname[0]), propname[1:]))(self.convert(prop, widget))
  File "/usr/lib64/python2.6/site-packages/PyQt4/uic/Compiler/qtproxies.py", line 90, in __call__
    ", ".join(map(obj_to_argument, args)))
  File "/usr/lib64/python2.6/site-packages/PyQt4/uic/Compiler/qtproxies.py", line 25, in obj_to_argument
    arg = str(obj)
  File "/usr/bin/pykdeuic4", line 42, in __str__
    return "kdecore.i18n(\"%s\")" % (self.escape(self.string),)
AttributeError: 'kde_i18n_string' object has no attribute 'escape'
make: *** [connectDialog.py] Error 1
make: *** Deleting file `connectDialog.py'
make: Leaving directory `/home/md401/pants/sakusen/kiai'

This appears to be because "escape" is no longer a method on qtproxies.i18n_string, but now just a function in the qtproxies module.
Changing line 42 of pykdeuic4 from
        return "kdecore.i18n(\"%s\")" % (self.escape(self.string),)
to
        return "kdecore.i18n(\"%s\")" % (qtproxies.escape(self.string),)
removed the error and gave me a pykdeuic4 that functioned as expected.
Comment 1 Simon Edwards 2009-12-21 20:22:35 UTC
SVN commit 1064784 by sedwards:

Fix pykdeuic4 for PyQt 4.6.2 and later.

Thanks to Michael Donaghy.

BUG: 217537


 M  +1 -1      pykdeuic4.py  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1064784