Добавлена возможность получить имя хоста cl-core через dbus

legacy27 3.6.0.3
Mike Hiretsky 6 years ago
parent 4bfbcd718c
commit 01279ab337

@ -58,3 +58,18 @@ def run_dbus_core(hostname, port):
pass
except ImportError:
pass
def get_dbus_hostname():
try:
bus = dbus.SystemBus()
DBUS_INTERFACE="org.calculate.CoreInterface"
DBUS_NAME="org.calculate.Core"
DBUS_OBJECT="/Core"
try:
remote_object = bus.get_object(DBUS_NAME, DBUS_OBJECT)
return str(remote_object.ServerHostname())
except dbus.DBusException:
pass
except ImportError:
pass
return ""

Loading…
Cancel
Save