From 4660e856ca0760f74cc06e19441ffc34a0e9b5b7 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sat, 1 May 2010 14:29:54 +0200 Subject: [PATCH] Fix more pylint warnings --- mopidy/__init__.py | 3 ++- mopidy/backends/gstreamer.py | 8 ++++---- mopidy/mixers/__init__.py | 3 +++ mopidy/mixers/alsa.py | 3 ++- mopidy/mixers/denon.py | 4 +++- mopidy/mixers/dummy.py | 3 ++- mopidy/mixers/nad.py | 3 ++- 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/mopidy/__init__.py b/mopidy/__init__.py index 8d1d45ac..eb53958c 100644 --- a/mopidy/__init__.py +++ b/mopidy/__init__.py @@ -7,7 +7,8 @@ def get_mpd_protocol_version(): return u'0.16.0' class MopidyException(Exception): - def __init__(self, message): + def __init__(self, message, *args, **kwargs): + super(MopidyException, self).__init__(message, *args, **kwargs) self._message = message @property diff --git a/mopidy/backends/gstreamer.py b/mopidy/backends/gstreamer.py index f4ed07e6..baa3c221 100644 --- a/mopidy/backends/gstreamer.py +++ b/mopidy/backends/gstreamer.py @@ -104,17 +104,17 @@ class GStreamerPlaybackController(BasePlaybackController): return 0 def destroy(self): - bin, self._bin = self._bin, None + playbin, self._bin = self._bin, None bus, self._bus = self._bus, None bus.disconnect(self._bus_id) bus.remove_signal_watch() - bin.get_state() - bin.set_state(gst.STATE_NULL) + playbin.get_state() + playbin.set_state(gst.STATE_NULL) bus.set_flushing(True) del bus - del bin + del playbin class GStreamerStoredPlaylistsController(BaseStoredPlaylistsController): diff --git a/mopidy/mixers/__init__.py b/mopidy/mixers/__init__.py index 7d1dfa56..31e5ae8e 100644 --- a/mopidy/mixers/__init__.py +++ b/mopidy/mixers/__init__.py @@ -1,4 +1,7 @@ class BaseMixer(object): + def __init__(self, *args, **kwargs): + pass + @property def volume(self): """ diff --git a/mopidy/mixers/alsa.py b/mopidy/mixers/alsa.py index 03133dbe..12bc9193 100644 --- a/mopidy/mixers/alsa.py +++ b/mopidy/mixers/alsa.py @@ -8,7 +8,8 @@ class AlsaMixer(BaseMixer): volume. """ - def __init__(self): + def __init__(self, *args, **kwargs): + super(AlsaMixer, self).__init__(*args, **kwargs) self._mixer = alsaaudio.Mixer() def _get_volume(self): diff --git a/mopidy/mixers/denon.py b/mopidy/mixers/denon.py index 3218dbe5..7cdf0d7b 100644 --- a/mopidy/mixers/denon.py +++ b/mopidy/mixers/denon.py @@ -26,11 +26,13 @@ class DenonMixer(BaseMixer): - :attr:`mopidy.settings.MIXER_EXT_PORT` -- Example: ``/dev/ttyUSB0`` """ - def __init__(self, device=None): + def __init__(self, *args, **kwargs): """ Connects using the serial specifications from Denon's RS-232 Protocol specification: 9600bps 8N1. """ + super(DenonMixer, self).__init__(*args, **kwargs) + device = kwargs.get('device', None) self._device = device or Serial(port=MIXER_EXT_PORT, timeout=0.2) self._levels = ['99'] + ["%(#)02d" % {'#': v} for v in range(0, 99)] self._volume = 0 diff --git a/mopidy/mixers/dummy.py b/mopidy/mixers/dummy.py index 38af7186..b0ea0e47 100644 --- a/mopidy/mixers/dummy.py +++ b/mopidy/mixers/dummy.py @@ -3,7 +3,8 @@ from mopidy.mixers import BaseMixer class DummyMixer(BaseMixer): """Mixer which just stores and reports the chosen volume.""" - def __init__(self): + def __init__(self, *args, **kwargs): + super(DummyMixer, self).__init__(*args, **kwargs) self._volume = None def _get_volume(self): diff --git a/mopidy/mixers/nad.py b/mopidy/mixers/nad.py index 4aec79cd..1f7f4710 100644 --- a/mopidy/mixers/nad.py +++ b/mopidy/mixers/nad.py @@ -40,7 +40,8 @@ class NadMixer(BaseMixer): """ - def __init__(self): + def __init__(self, *args, **kwargs): + super(NadMixer, self).__init__(*args, **kwargs) self._volume = None self._pipe, other_end = Pipe() NadTalker(pipe=other_end).start()