Various pylint fixes
This commit is contained in:
parent
53bc3cec6a
commit
0bcda9920b
@ -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]
|
||||
|
||||
@ -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])
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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__):
|
||||
|
||||
@ -643,7 +643,7 @@ class MpdFrontend(object):
|
||||
- capitalizes the type argument.
|
||||
"""
|
||||
type = type.lower()
|
||||
pass # TODO
|
||||
# TODO
|
||||
|
||||
@handle_pattern(r'^listall "(?P<uri>[^"]+)"')
|
||||
def _music_db_listall(self, uri):
|
||||
|
||||
@ -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::
|
||||
#:
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user