|
|
|
@ -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 ""
|
|
|
|
|