Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option to use the system bus. #10

Merged
merged 1 commit into from
May 5, 2015
Merged

Conversation

tlaundal
Copy link

This commit adds a config option to use the system bus instead of the session bus. This change makes it possible to expose Mopidy through an MPRIS interface even when it's run in its own user without a session bus.

This commit relates closely to issue #9, and might solve it as far as possible within the scope of this extension.

The check for whether the $DISPLAY X11 environment variable is set is removed from the validate_environment(self) method in the main Extension class. Dbus will take care of this error, and there is already logic to handle it in the code that deals with dbus. the error will now be printed like this:

WARNING  MPRIS frontend setup failed (org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11)

This error message is equally verbose and easy to spot.

@tlaundal tlaundal force-pushed the master branch 2 times, most recently from f5b6775 to 0775fae Compare February 23, 2015 17:45
@kingosticks
Copy link
Member

Travis doesn't like this.

@@ -5,6 +5,7 @@

import pykka

from mopidy import exceptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mopidy_mpris/frontend.py:8:1: F401 'exceptions' imported but unused

@kingosticks
Copy link
Member

Well, the other failure isn't actually yours but it's still broken

@tlaundal
Copy link
Author

Yeah, build 46.1 fails because of a missing dependency or something, which is not my fault, and 46.2 fails because I forgot to remove that import when I didn't use it anymore. I'll fix the import later today.

This commit adds a config option to use the system bus instead of the session bus. This change makes it possible to expose Mopidy through an MPRIS interface even when it's run in its own user without a session bus.

This commit relates closely to issue mopidy#9, and might solve it as far as possible within the scope of this extension.

The check for whether the `$DISPLAY` X11 environment variable is set is removed from the `validate_environment(self)` method in the main Extension class. Dbus will take care of this error, and there is already logic to handle it in the code that deals with dbus. the error will now be printed like this:

    WARNING  MPRIS frontend setup failed (org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11)

This error message is equally verbose and easy to spot.

Signed-off-by: totokaka <mail@totokaka.io>
@tlaundal
Copy link
Author

The last build fixed the Travis build, at least the pyflakes part. The other build failing is due to a missing mopidy module or something.

@jodal
Copy link
Member

jodal commented Feb 24, 2015

Yeah, the other part is my fault for moving stuff in the Mopidy project. I'll work around it in -MPRIS.

@jodal jodal merged commit 2107f12 into mopidy:master May 5, 2015
jodal added a commit that referenced this pull request May 5, 2015
jodal added a commit that referenced this pull request May 5, 2015
Builds upon PR #10, and:

- Change "system_bus" config value to "bus_type"
- Log what type of bus we connect to
- Reorganize config docs
- Update changelog

Fixes #9
@jodal jodal self-assigned this May 5, 2015
@jodal
Copy link
Member

jodal commented May 5, 2015

Thanks for taking the time to add this! The tests passed as soon as I made them pass in the master branch again.

Since I've let this PR stay untouched for so long, I made some changes myself rather than bug you about them. See commit e0a037c if you're interested.

@jodal jodal added this to the v1.2.0 milestone Dec 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants