1 from ibus
import interface
4 FACTORY_PATH
= "/com/redhat/IBus/engines/Demo/Factory"
5 ENGINE_PATH
= "/com/redhat/IBus/engines/Demo/Engine/%d"
7 class DemoEngineFactory (interface
.IEngineFactory
):
11 AUTHORS
= "Huang Peng <shawn.p.huang@gmail.com>"
14 def __init__ (self
, dbusconn
):
15 interface
.IEngineFactory
.__init
__ (self
, dbusconn
, object_path
= FACTORY_PATH
)
16 self
._dbusconn
= dbusconn
17 self
._max
_engine
_id
= 1
28 def CreateEngine (self
):
29 engine_path
= ENGINE_PATH
% self
._max
_engine
_id
30 self
._max
_engine
_id
+= 1
31 return engine
.DemoEngine (self
._dbusconn
, engine_path
)