Add Destory method for IEngineFactory
[ibus.git] / ibus / common.py
blob58d3ef6bfcf29446061332d057bf746aa6fd9306
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 __all__ = (
23 "IBUS_ADDR",
24 "IBUS_IFACE",
25 "IBUS_NAME",
26 "IBUS_PATH",
27 "IBUS_CONFIG_IFACE",
28 "IBUS_ENGINE_FACTORY_IFACE",
29 "IBUS_ENGINE_IFACE",
30 "IBUS_PANEL_IFACE",
31 "default_reply_handler",
32 "default_error_handler",
33 "DEFAULT_ASYNC_HANDLERS"
36 import os
37 import sys
38 import getpass
40 IBUS_ADDR = "unix:path=/tmp/ibus-%s/ibus-%s" % (getpass.getuser (), os.environ["DISPLAY"].replace (":", "-"))
41 # IBUS_ADDR = "tcp:host=localhost,port=7799"
43 IBUS_IFACE = "org.freedesktop.IBus"
44 IBUS_PATH = "/org/freedesktop/IBus"
45 IBUS_NAME = "org.freedesktop.IBus"
47 IBUS_CONFIG_IFACE = "org.freedesktop.IBus.Config"
48 IBUS_ENGINE_FACTORY_IFACE = "org.freedesktop.IBus.EngineFactory"
49 IBUS_ENGINE_IFACE = "org.freedesktop.IBus.Engine"
50 IBUS_PANEL_IFACE = "org.freedesktop.IBus.Panel"
52 def default_reply_handler ( *args):
53 pass
55 def default_error_handler (e):
56 print >> sys.stderr, e
58 DEFAULT_ASYNC_HANDLERS = {
59 "reply_handler" : default_reply_handler,
60 "error_handler" : default_error_handler