rendered paste body # --- Methods --- @dbus.service.method(MISSION_CONTROL_INTERFACE, in_signature='ss', out_signature='') def SetPresence(self, name, message): self.presence = (name, message) PresenceStore().save(self.presence) for account in self.accounts: self.set_presence(account) @dbus.service.method(MISSION_CONTROL_INTERFACE, in_signature='', out_signature='ss') def GetPresence(self): return self.presence @dbus.service.method(MISSION_CONTROL_INTERFACE, in_signature='', out_signature='a(soss)') def GetConnectedAccounts(self): result = [] for account in self.accounts: if not account.is_connected(): continue result += [(get_proxy_provider().get_service(account.conn_obj), account.conn_obj, account.profile.protocol, account.get_username())] return result @dbus.service.method(MISSION_CONTROL_INTERFACE, in_signature='sosuu', out_signature='') def RequestChannel(self, conn_name, conn_obj, chan_type, handle_type, handle): conn_iface = get_proxy_provider().get_iface(conn_obj, "org.freedesktop.Telepathy.Connection") conn_iface.RequestChannel(chan_type, handle_type, handle, True, reply_handler=lambda chan_obj: self.channel_handler.handle_channel(conn_name, conn_obj, chan_obj, chan_type, handle_type, handle), error_handler=global_error_handler) @dbus.service.method(MISSION_CONTROL_UI_INTERFACE, in_signature='', out_signature='') def ShowAccounts(self): from cohoba.houston.ui.AccountsWindow import AccountsWindow AccountsWindow().show() # --- Signals --- @dbus.service.signal(MISSION_CONTROL_INTERFACE, signature='so') def AccountConnected(self, bus_name, object_path): self.channel_handler.handle_connection(bus_name, object_path)