def get_dbus_method(method_name): dbus_loop = DBusGMainLoop() connection = BusConnection(mainloop=dbus_loop) bus_name = "com.canonical.Unity" object_path = "/com/canonical/Unity/Session" session_object = connection.get_object(bus_name, object_path) interface = dbus.Interface(session_object, bus_name + ".Session") method = interface.get_dbus_method(method_name) return method
def get_dbus_method(method_name): dbus_loop = DBusGMainLoop() connection = BusConnection(mainloop=dbus_loop) bus_name = "org.gnome.SessionManager" object_path = "/org/gnome/SessionManager" session_object = connection.get_object(bus_name, object_path) interface = dbus.Interface(session_object, bus_name) method = interface.get_dbus_method(method_name) return method
def get_dbus_method(method_name): dbus_loop = DBusGMainLoop() connection = BusConnection(mainloop=dbus_loop) bus_name = "org.gnome.SessionManager" object_path = "/org/gnome/SessionManager" session_object = connection.get_object(bus_name, object_path) interface = dbus.Interface(session_object, bus_name) method = interface.get_dbus_method(method_name) return method
def main(): size = Size(800, 600) mainloop = GLib.MainLoop() DBusGMainLoop(set_as_default=True) sleep(10) bus = BusConnection(getenv("DBUS_ADDRESS") or DBUS_ADDRESS) remote_object = bus.get_object(BUS_NAME, OBJECT_PATH) process = Popen(ffplay_command(size), stdin=PIPE) remote_object.connect_to_signal("FrameEmitted", partial(handle_frame, process.stdin), dbus_interface=DBUS_INTERFACE) remote_object.EmitFrames() #print(remote_object.Capitalize("hello world")) print("Starting player... ", flush=True) mainloop.run()