comparison sat/bridge/bridge_constructor/constructors/dbus/dbus_core_template.py @ 2628:779351da2c13

core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation: generation of D-Bus bridge has been broken by black formatting tool, this patch fixes this.
author Goffi <goffi@goffi.org>
date Sun, 01 Jul 2018 20:37:58 +0200
parents 56f94936df1e
children 003b8b4b56a7
comparison
equal deleted inserted replaced
2627:163aab916bcf 2628:779351da2c13
26 26
27 log = getLogger(__name__) 27 log = getLogger(__name__)
28 from twisted.internet.defer import Deferred 28 from twisted.internet.defer import Deferred
29 from sat.core.exceptions import BridgeInitError 29 from sat.core.exceptions import BridgeInitError
30 30
31 const_INT_PREFIX = "org.goffi.SAT" # Interface prefix 31 const_INT_PREFIX = "org.salutatoi.SAT" # Interface prefix
32 const_ERROR_PREFIX = const_INT_PREFIX + ".error" 32 const_ERROR_PREFIX = const_INT_PREFIX + ".error"
33 const_OBJ_PATH = "/org/goffi/SAT/bridge" 33 const_OBJ_PATH = "/org/salutatoi/SAT/bridge"
34 const_CORE_SUFFIX = ".core" 34 const_CORE_SUFFIX = ".core"
35 const_PLUGIN_SUFFIX = ".plugin" 35 const_PLUGIN_SUFFIX = ".plugin"
36 36
37 37
38 class ParseError(Exception): 38 class ParseError(Exception):
126 # FIXME: workaround for addSignal (doesn't work if one method doensn't 126 # FIXME: workaround for addSignal (doesn't work if one method doensn't
127 # already exist for plugins), probably missing some initialisation, need 127 # already exist for plugins), probably missing some initialisation, need
128 # further investigations 128 # further investigations
129 pass 129 pass
130 130
131 ##SIGNALS_PART## 131 ##SIGNALS_PART##
132 ### methods ### 132 ### methods ###
133 133
134 ##METHODS_PART## 134 ##METHODS_PART##
135 def __attributes(self, in_sign): 135 def __attributes(self, in_sign):
136 """Return arguments to user given a in_sign 136 """Return arguments to user given a in_sign
137 @param in_sign: in_sign in the short form (using s,a,i,b etc) 137 @param in_sign: in_sign in the short form (using s,a,i,b etc)
138 @return: list of arguments that correspond to a in_sign (e.g.: "sss" return "arg1, arg2, arg3")""" 138 @return: list of arguments that correspond to a in_sign (e.g.: "sss" return "arg1, arg2, arg3")"""
139 i = 0 139 i = 0
270 ) 270 )
271 raise BridgeInitError 271 raise BridgeInitError
272 self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus) 272 self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus)
273 self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH) 273 self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH)
274 274
275 ##SIGNAL_DIRECT_CALLS_PART## 275 ##SIGNAL_DIRECT_CALLS_PART##
276 def register_method(self, name, callback): 276 def register_method(self, name, callback):
277 log.debug("registering DBus bridge method [%s]" % name) 277 log.debug("registering DBus bridge method [%s]" % name)
278 self.dbus_bridge.register_method(name, callback) 278 self.dbus_bridge.register_method(name, callback)
279 279
280 def addMethod(self, name, int_suffix, in_sign, out_sign, method, async=False, doc={}): 280 def addMethod(self, name, int_suffix, in_sign, out_sign, method, async=False, doc={}):