summaryrefslogtreecommitdiffstats
path: root/ibus
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-08-19 09:23:37 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-08-19 09:23:37 +0800
commit4d34dbaff9e0163ce9c1005dac11797e5ca6b7ca (patch)
treeb62260b105aeb8505c19ba06d058d31e820cce9d /ibus
parent539913da27823ee2884b60db92ae87a94d654069 (diff)
downloadibus-4d34dbaff9e0163ce9c1005dac11797e5ca6b7ca.tar.gz
ibus-4d34dbaff9e0163ce9c1005dac11797e5ca6b7ca.tar.xz
ibus-4d34dbaff9e0163ce9c1005dac11797e5ca6b7ca.zip
Refine code.
Diffstat (limited to 'ibus')
-rw-r--r--ibus/property.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ibus/property.py b/ibus/property.py
index 5a952e7..da769ce 100644
--- a/ibus/property.py
+++ b/ibus/property.py
@@ -51,6 +51,7 @@ def _to_unicode(text):
return text
if isinstance(text, str):
return unicode(text, "utf8")
+ raise TypeError("text must be instance of unicode or str")
class Property(object):
def __init__(self, name,
@@ -238,6 +239,9 @@ def test():
props.append(p)
value = props.to_dbus_value()
print prop_list_from_dbus_value(value)
+ p.label = u"a"
+ p.label = "a"
+ p.label = 1
if __name__ == "__main__":
test()