comparison sat/bridge/dbus_bridge.py @ 3143:830fce0db15d

bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
author Goffi <goffi@goffi.org>
date Wed, 29 Jan 2020 18:54:40 +0100
parents 559a625a236b
children d10b2368684e
comparison
equal deleted inserted replaced
3142:cd90c24b2836 3143:830fce0db15d
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 2
3 3 # SàT communication bridge
4 # SAT: a jabber client
5 # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org) 4 # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org)
6 5
7 # This program is free software: you can redistribute it and/or modify 6 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by 7 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or 8 # the Free Software Foundation, either version 3 of the License, or
21 import dbus 20 import dbus
22 import dbus.service 21 import dbus.service
23 import dbus.mainloop.glib 22 import dbus.mainloop.glib
24 import inspect 23 import inspect
25 from sat.core.log import getLogger 24 from sat.core.log import getLogger
26 25 from sat.tools import config
27 log = getLogger(__name__)
28 from twisted.internet.defer import Deferred 26 from twisted.internet.defer import Deferred
29 from sat.core.exceptions import BridgeInitError 27 from sat.core.exceptions import BridgeInitError
30 28
31 const_INT_PREFIX = "org.salutatoi.SAT" # Interface prefix 29
30 log = getLogger(__name__)
31
32 # Interface prefix
33 const_INT_PREFIX = config.getConfig(
34 config.parseMainConf(),
35 "",
36 "bridge_dbus_int_prefix",
37 "org.salutatoi.SAT")
32 const_ERROR_PREFIX = const_INT_PREFIX + ".error" 38 const_ERROR_PREFIX = const_INT_PREFIX + ".error"
33 const_OBJ_PATH = "/org/salutatoi/SAT/bridge" 39 const_OBJ_PATH = "/org/salutatoi/SAT/bridge"
34 const_CORE_SUFFIX = ".core" 40 const_CORE_SUFFIX = ".core"
35 const_PLUGIN_SUFFIX = ".plugin" 41 const_PLUGIN_SUFFIX = ".plugin"
36 42