diff --git a/mopidy/backends/__init__.py b/mopidy/backends/__init__.py index f7705f64..611c88d4 100644 --- a/mopidy/backends/__init__.py +++ b/mopidy/backends/__init__.py @@ -176,7 +176,8 @@ class BaseCurrentPlaylistController(object): assert start >= 0, 'start must be at least zero' assert end <= len(tracks), 'end can not be larger than playlist length' assert to_position >= 0, 'to_position must be at least zero' - assert to_position <= len(tracks), 'to_position can not be larger than playlist length' + assert to_position <= len(tracks), 'to_position can not be larger ' + \ + 'than playlist length' new_tracks = tracks[:start] + tracks[end:] for track in tracks[start:end]: @@ -218,7 +219,8 @@ class BaseCurrentPlaylistController(object): assert start >= 0, 'start must be at least zero' if end is not None: - assert end <= len(tracks), 'end can not be larger than playlist length' + assert end <= len(tracks), 'end can not be larger than ' + \ + 'playlist length' before = tracks[:start or 0] shuffled = tracks[start:end] diff --git a/mopidy/mixers/denon.py b/mopidy/mixers/denon.py index 9d065d9a..3218dbe5 100644 --- a/mopidy/mixers/denon.py +++ b/mopidy/mixers/denon.py @@ -37,7 +37,7 @@ class DenonMixer(BaseMixer): self._lock = Lock() def _get_volume(self): - self._lock.acquire(); + self._lock.acquire() self.ensure_open_device() self._device.write('MV?\r') vol = str(self._device.readline()[2:4]) diff --git a/mopidy/mixers/osa.py b/mopidy/mixers/osa.py index 6291cac1..3aeaed5c 100644 --- a/mopidy/mixers/osa.py +++ b/mopidy/mixers/osa.py @@ -17,7 +17,7 @@ class OsaMixer(BaseMixer): and (int(time.time() - self._last_update) < self.CACHE_TTL)) def _get_volume(self): - if not self._valid_cache(): + if not self._valid_cache(): try: self._cache = int(Popen( ['osascript', '-e', diff --git a/mopidy/models.py b/mopidy/models.py index d2b1e76a..b9c73783 100644 --- a/mopidy/models.py +++ b/mopidy/models.py @@ -18,10 +18,10 @@ class ImmutableObject(object): raise AttributeError('Object is immutable.') def __hash__(self): - sum = 0 - for key,value in self.__dict__.items(): - sum += hash(key) + hash(value) - return sum + hash_sum = 0 + for key, value in self.__dict__.items(): + hash_sum += hash(key) + hash(value) + return hash_sum def __eq__(self, other): if not isinstance(other, self.__class__): diff --git a/mopidy/mpd/frontend.py b/mopidy/mpd/frontend.py index c2ac84ea..21d1752b 100644 --- a/mopidy/mpd/frontend.py +++ b/mopidy/mpd/frontend.py @@ -643,7 +643,7 @@ class MpdFrontend(object): - capitalizes the type argument. """ type = type.lower() - pass # TODO + # TODO @handle_pattern(r'^listall "(?P[^"]+)"') def _music_db_listall(self, uri): diff --git a/mopidy/settings.py b/mopidy/settings.py index d160b26c..886e7189 100644 --- a/mopidy/settings.py +++ b/mopidy/settings.py @@ -26,7 +26,8 @@ BACKENDS = ( #: The log format used on the console. See #: http://docs.python.org/library/logging.html#formatter-objects for details on #: the format. -CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s' +CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s' + \ + ' [%(process)d:%(threadName)s] %(name)s\n %(message)s' #: Protocol frontend to use. Default:: #: diff --git a/mopidy/utils.py b/mopidy/utils.py index 19c33790..3b5de37d 100644 --- a/mopidy/utils.py +++ b/mopidy/utils.py @@ -130,8 +130,8 @@ def parse_m3u(file_path): if line.startswith('file://'): uris.append(line) else: - file = os.path.join(folder, line) - path = urllib.pathname2url(file.encode('utf-8')) + path = os.path.join(folder, line) + path = urllib.pathname2url(path.encode('utf-8')) uris.append('file://' + path) return uris