Skip to content

Commit

Permalink
flake8: Fix new warnings after flake8 upgrade
Browse files Browse the repository at this point in the history
(cherry picked from commit a693993)

Conflicts:
	mopidy/audio/actor.py
	mopidy/audio/playlists.py
  • Loading branch information
jodal committed Feb 12, 2015
1 parent 7fd0603 commit 77128e4
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions mopidy/audio/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def _setup_playbin(self):
playbin = gst.element_factory_make('playbin2')
playbin.set_property('flags', PLAYBIN_FLAGS)

playbin.set_property('buffer-size', 2*1024*1024)
playbin.set_property('buffer-duration', 2*gst.SECOND)
playbin.set_property('buffer-size', 2 * 1024 * 1024)
playbin.set_property('buffer-duration', 2 * gst.SECOND)

self._connect(playbin, 'about-to-finish', self._on_about_to_finish)
self._connect(playbin, 'notify::source', self._on_new_source)
Expand Down
4 changes: 2 additions & 2 deletions mopidy/audio/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def parse_pls(data):
for section in cp.sections():
if section.lower() != 'playlist':
continue
for i in xrange(cp.getint(section, 'numberofentries')):
yield cp.get(section, 'file%d' % (i+1))
for i in range(cp.getint(section, 'numberofentries')):
yield cp.get(section, 'file%d' % (i + 1))


def parse_xspf(data):
Expand Down
2 changes: 1 addition & 1 deletion mopidy/local/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_config_schema(self):
schema['playlists_dir'] = config.Path()
schema['tag_cache_file'] = config.Deprecated()
schema['scan_timeout'] = config.Integer(
minimum=1000, maximum=1000*60*60)
minimum=1000, maximum=1000 * 60 * 60)
schema['scan_flush_threshold'] = config.Integer(minimum=0)
schema['excluded_file_extensions'] = config.List(optional=True)
return schema
Expand Down
2 changes: 1 addition & 1 deletion mopidy/local/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, uris):
parent_uri = None
child = None
for i in reversed(range(len(parts))):
directory = '/'.join(parts[:i+1])
directory = '/'.join(parts[:i + 1])
uri = translator.path_to_local_directory_uri(directory)

# First dir we process is our parent
Expand Down
2 changes: 1 addition & 1 deletion mopidy/local/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def m3u_extinf_to_track(line):
return Track()
(runtime, title) = m.groups()
if int(runtime) > 0:
return Track(name=title, length=1000*int(runtime))
return Track(name=title, length=1000 * int(runtime))
else:
return Track(name=title)

Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[flake8]
application-import-names = mopidy,tests
exclude = .git,.tox,build,js
# Ignored flake8 warnings:
# - E402 module level import not at top of file
# - E731 do not assign a lambda expression, use a def
ignore = E402,E731

[wheel]
universal = 1
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __eq__(self, rhs):
try:
return isinstance(rhs, self.klass)
except TypeError:
return type(rhs) == type(self.klass)
return type(rhs) == type(self.klass) # flake8: noqa

def __ne__(self, rhs):
return not self.__eq__(rhs)
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def test_inspector_can_describe_a_bunch_of_large_classes(self):
'core.library': core.LibraryController,
'core.playback': core.PlaybackController,
'core.playlists': core.PlaylistsController,
'core.tracklist': core.TracklistController,
'core.tracklist': core.TracklistController,
})

methods = inspector.describe()
Expand Down

0 comments on commit 77128e4

Please sign in to comment.