Merge lp:~jamiebennett/entertainer/bug-372452-disable-screensaver into lp:entertainer
Proposed by
Jamie Bennett
Status: | Needs review |
---|---|
Proposed branch: | lp:~jamiebennett/entertainer/bug-372452-disable-screensaver |
Merge into: | lp:entertainer |
Diff against target: |
96 lines (+43/-0) 2 files modified
entertainerlib/client/client.py (+2/-0) entertainerlib/client/media_player.py (+41/-0) |
To merge this branch: | bzr merge lp:~jamiebennett/entertainer/bug-372452-disable-screensaver |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matt Layman | Needs Fixing | ||
Review via email:
|
Description of the change
Disable the screensaver whist video is being played.
Closes bug (LP:372452).
To post a comment you must log in.
Unmerged revisions
- 413. By Jamie Bennett
-
Disable the screensaver whilst video is being played.
Jamie,
I really like the spirit of this branch because this is a much needed fix, but there are number of things that prevent me from merging this into the trunk. My comments follow:
general:
* Adding a dependency of dbus means that you need to update the docs/DEPENDENCIES file to include python-dbus.
entertainerlib/ client/ client. py:
* I think this really introduces a dependency in the client that shouldn't be there. I would suggest that the proper way to enable the screensaver before the client closes down is to use the instance variable you created in the media player. This could be done by adding a __del__ method to the media player that calls enable_screensaver. This would localize your dependency to the one place that needs it.
entertainerlib/ client/ media_player. py: bitor, but that's just a suggestion. saver_inhibitor ` or `self.inhibitor` would be better. screensaver? That would lead to a problem if the code ever called enable_screensaver first. Why can't it be moved to init?
* Import order is wrong. dbus would go after clutter.
* There are tab characters strewn about in your file which is a no-no based on our style guidelines. Has this code been tested? I made a little test file that used a mix of spaces and tabs, and it flat out failed because of indentation errors. That makes me highly suspect of the code that is here.
* Class names are typically nouns. You've provided a class name that seems more like a method. As a matter of fact, there are many handle_* methods in Entertainer. Could you select a more appropriate name? The first thing that popped into my head was ScreenSaverInhi
* On the subject of names, the instance name in the media player is not meaningful either. 'ss' tells me almost nothing if I know the context, and absolutely nothing if I don't know the context. Entertainer's code mostly tends towards verbosity at the cost of conciseness. If following my suggestion for a class name, `self.screen_
* The class should be a new style class (i.e. derive from `object`).
* The class requires a docstring.
* The existing docstrings require full stops at the end of each sentence.
* Inconsistent use of single versus double quotes. Please stick with one or the other. Most of the code leans towards single quotes, but it's not universally true. But the code should at least have consistency in its code block.
* The wrapping behavior is inconsistent with Entertainer conventions. If a line of code is meant to wrap, it should only be indented 4 spaces from the previous line that it is continuing. If that source line has multiple physical lines of wrap, then each line after the original should line up with each other.
* Why is dbus_interface only assigned for the first time during a call to disable_
* Why is ss_cookie converting from string to an instance of Inhibit? In init, I think ss_cookie should be None.
* Why does disable_screensaver need to be called in enable_screensaver if there is no cookie? I guess maybe that would be necessary if you had multiple instances of this class, but if you localized the instance to the media_player, then I think that logic becomes unnecessary. If no cookie is set, then it should be safe to a...