From 48cc200d7dbe999f92b05507a7c59bea42ac6f1c Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Tue, 12 Jul 2011 15:14:59 +0900 Subject: [PATCH] Fixed an error in IBus.Bus.register_component TEST=Linux desktop Review URL: http://codereview.appspot.com/4668060 --- ibus/component.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ibus/component.py b/ibus/component.py index 12f593d..7255ee1 100644 --- a/ibus/component.py +++ b/ibus/component.py @@ -94,6 +94,11 @@ class Component(Serializable): engine = EngineDesc(name, longname, description, language, license, author, icon, layout, hotkeys) self.__engines.append(engine) + def add_engines(self, engines): + if not isinstance(engines, list): + raise TypeError("engines must be an instance of list") + self.__engines.extend(engines) + def serialize(self, struct): super(Component, self).serialize(struct) struct.append (dbus.String(self.__name)) @@ -106,8 +111,6 @@ class Component(Serializable): struct.append (dbus.String(self.__textdomain)) struct.append (dbus.Array(map(serialize_object,self.__observed_paths), signature="v")) struct.append (dbus.Array(map(serialize_object,self.__engines), signature="v")) - # New properties of Component will use dict for serialize - struct.append(dbus.Array({}, signature=None)) def deserialize(self, struct): super(Component, self).deserialize(struct) @@ -123,8 +126,6 @@ class Component(Serializable): self.__observed_paths = map(deserialize_object, struct.pop(0)) self.__engines = map(deserialize_object, struct.pop(0)) - # New properties of Component will use dict for serialize - #value = struct.pop(0) def test(): text = Component("Hello", "", "", "", "", "", "", "") -- 2.7.4