Add a template engine - enchant.
[ibus-anthy.git] / engine / factory.py
blobddca0136facffbda06a7d2f52dcbf153213b90ef
1 # vim:set noet ts=4:
3 # ibus - The Input Bus
5 # Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this program; if not, write to the
19 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 # Boston, MA 02111-1307 USA
22 from ibus import interface
23 import engine
25 FACTORY_PATH = "/com/redhat/IBus/engines/Demo/Factory"
26 ENGINE_PATH = "/com/redhat/IBus/engines/Demo/Engine/%d"
28 class DemoEngineFactory (interface.IEngineFactory):
29 NAME = "Enchant"
30 LANG = "en"
31 ICON = ""
32 AUTHORS = "Huang Peng <shawn.p.huang@gmail.com>"
33 CREDITS = "GPLv2"
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
40 def GetInfo (self):
41 return [
42 self.NAME,
43 self.LANG,
44 self.ICON,
45 self.AUTHORS,
46 self.CREDITS
49 def CreateEngine (self):
50 engine_path = ENGINE_PATH % self._max_engine_id
51 self._max_engine_id += 1
52 return engine.DemoEngine (self._dbusconn, engine_path)