Hi,
In an early version of PyQt(< 4.4.4) we were having problems about loading ui
files with Turkish locale like:
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
And this problem was fixed after this thread[1], and PyQt 4.4.4 was fine. But
in PyQt 4.5, according patch in the thread (also attached) is not included. Is
this intentional or just forgotten? Can you include it again in next release?
Thanks.
[1] http://www.mail-archive.com/[email protected]/msg11374.html
--
Gökçen Eraslan
Pardus Developer
--- a/pyuic/uic/properties.py 2009-06-05 11:50:39.000000000 +0300
+++ b/pyuic/uic/properties.py 2009-04-29 09:45:55.000000000 +0300
@@ -1 +1,3 @@
import logging
+import string
+
@@ -10,6 +12,14 @@
QtGui = None
+# A translation table for converting ASCII lower case to upper case.
+_ascii_trans_table = string.maketrans(string.ascii_lowercase, string.ascii_uppercase)
+
+# Convert a string to ASCII upper case irrespective of the current locale.
+def ascii_upper(s):
+ return s.translate(_ascii_trans_table)
+
+
def int_list(prop):
return [int(child.text) for child in prop]
@@ -261,7 +267,8 @@
elif hasattr(self, propname):
getattr(self, propname)(widget, prop)
else:
- getattr(widget, "set%s%s" % (propname[0].upper(), propname[1:]))(self.convert(prop, widget))
+ getattr(widget, "set%s%s" % (ascii_upper(propname[0]),
+ propname[1:]))(self.convert(prop, widget))
# SPECIAL PROPERTIES
# If a property has a well-known value type but needs special,
@@ -271,8 +278,8 @@
# populated.
def _delay(self, widget, prop):
propname = prop.attrib["name"]
- self.delayed_props.append((
- getattr(widget, "set%s%s" % (propname[0].upper(), propname[1:])),
+ self.delayed_props.append((getattr(widget,
+ "set%s%s" % (ascii_upper(propname[0]), propname[1:])),
self.convert(prop)))
# These properties will be set with a widget.setProperty call rather than
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt