Add register method for EngineFactoryBase class.
authorHuang Peng <shawn.p.huang@gmail.com>
Fri, 25 Jul 2008 08:57:35 +0000 (16:57 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Fri, 25 Jul 2008 08:57:35 +0000 (16:57 +0800)
ibus/factory.py

index 36954dc5f6ae6d0b3ea67823f033842f05077331..dc9460ab7a6fe58f694c3a70bc6d99203c7ec2f2 100644 (file)
@@ -35,6 +35,7 @@ class EngineFactoryBase(ibus.Object):
         self.__engine_class = engine_class
         self.__engine_path = engine_path
         self.__engine_id = 1
+        self.__object_path = object_path
 
     def get_info(self):
         return self.__info
@@ -45,6 +46,10 @@ class EngineFactoryBase(ibus.Object):
     def uninitialize(self):
         pass
 
+    def register(self):
+        _ibus = self.__conn.get_ibus ()
+        _ibus.RegisterFactories([self.__object_path], **ibus.DEFAULT_ASYNC_HANDLERS)
+
     def create_engine(self):
         engine = self.__engine_class(self.__conn, self.__engine_path + str(self.__engine_id))
         self.__engine_id += 1