comparison sat_frontends/bridge/bridge_frontend.py @ 3539:60d3861e5996

bridge (dbus): use Tx DBus for backend part of D-Bus bridge: Due to recent SQLAlchemy integration, Libervia is now using AsyncIO loop exclusively as main loop, thus GLib's one can't be used anymore (event if it could be in a separate thread). Furthermore Python-DBus is known to have design flaws mentioned even in the official documentation. Tx DBus is now used to replace Python-DBus, but only for the backend for now, as it will need some work on the frontend before we can get completely rid of it.
author Goffi <goffi@goffi.org>
date Thu, 03 Jun 2021 15:21:43 +0200
parents be6d91572633
children
comparison
equal deleted inserted replaced
3538:c605a0d6506f 3539:60d3861e5996
26 26
27 @param name (str): full exception class name (with module) 27 @param name (str): full exception class name (with module)
28 @param message (str): error message 28 @param message (str): error message
29 @param condition (str) : error condition 29 @param condition (str) : error condition
30 """ 30 """
31 Exception.__init__(self) 31 super().__init__()
32 self.fullname = str(name) 32 self.fullname = str(name)
33 self.message = str(message) 33 self.message = str(message)
34 self.condition = str(condition) if condition else "" 34 self.condition = str(condition) if condition else ""
35 self.module, __, self.classname = str(self.fullname).rpartition(".") 35 self.module, __, self.classname = str(self.fullname).rpartition(".")
36 36
37 def __str__(self): 37 def __str__(self):
38 message = (": %s" % self.message) if self.message else "" 38 return self.classname + (f": {self.message}" if self.message else "")
39 return self.classname + message
40 39
41 def __eq__(self, other): 40 def __eq__(self, other):
42 return self.classname == other 41 return self.classname == other