[PyQt] Can't load UI files under Turkish locale

Ismail Dönmez ismail at pardus.org.tr
Thu Aug 2 12:08:57 BST 2007


Hi all,

uic/properties.py line 220 says :

getattr(widget, "set%s%s" % (propname[0].upper(), propname[1:]))(

The propname[0].upper() part is problematic for Turkish locale, because 
uppercase of "i" is not "I" in Turkish locale but its i-with-a-dot-above 
(İ) .

So trying to load a UI file results in an error :

  File "/usr/lib/python2.4/site-packages/PyQt4/uic/properties.py", line 220, 
in setProperties
    getattr(widget, "set%s%s" % (propname[0].upper(), propname[1:]))(
AttributeError: seticon

Notice the method name is seticon and not setIcon. Somehow ascii only upper 
should be done, something like :

import ascii

def ascii_upper(s):
	trans_table = string.maketrans(string.ascii_lowercase, 
string.ascii_uppercase)
	return s.translate(trans_table)

What do you think?

Regards,
ismail

-- 
Perfect is the enemy of good



More information about the PyQt mailing list