def _connect(self):
        try:
            self.player = self.bus.get_object(self.objname, '/Player')
            self.iface = dbus.Interface(
                self.player,
                dbus_interface='org.freedesktop.MediaPlayer'
            )
            # See: http://xmms2.org/wiki/MPRIS for info on signals
            # and what they mean.
            self.iface.connect_to_signal(
                "TrackChange",
                self.handle_track_change
            )
            self.iface.connect_to_signal(
                "StatusChange",
                self.handle_status_change
            )
            self.connected = True
        except dbus.exceptions.DBusException:
            logger.exception("exception initializing mpris")
            self.connected = False
Helper function.
dataset/ETHPy150Open qtile/qtile/libqtile/widget/mpriswidget.py/Mpris._connect--crossover with--dataset/ETHPy150Open adlibre/Adlibre-TMS/adlibre_tms/apps/tms/tests/helpers.py/client_login