2 # -*- coding: utf-8 -*-
4 # ibus-anthy - The Anthy engine for IBus
6 # Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 from ibus
import interface
25 FACTORY_PATH
= "/com/redhat/IBus/engines/Anthy/Factory"
26 ENGINE_PATH
= "/com/redhat/IBus/engines/Anthy/Engine/%d"
28 class DemoEngineFactory (interface
.IEngineFactory
):
32 AUTHORS
= "Huang Peng <shawn.p.huang@gmail.com>"
35 def __init__ (self
, dbusconn
):
36 interface
.IEngineFactory
.__init
__ (self
, dbusconn
, object_path
= FACTORY_PATH
)
37 self
._dbusconn
= dbusconn
38 self
._max
_engine
_id
= 1
49 def CreateEngine (self
):
50 engine_path
= ENGINE_PATH
% self
._max
_engine
_id
51 self
._max
_engine
_id
+= 1
52 return engine
.Engine (self
._dbusconn
, engine_path
)