Fix some pylint warnings

This commit is contained in:
Stein Magnus Jodal 2010-05-01 13:39:42 +02:00
parent fff0e046cf
commit 343e451b55

View File

@ -149,10 +149,10 @@ class GStreamerStoredPlaylistsController(BaseStoredPlaylistsController):
return return
self._playlists.remove(playlist) self._playlists.remove(playlist)
file = os.path.join(self._folder, playlist.name + '.m3u') filename = os.path.join(self._folder, playlist.name + '.m3u')
if os.path.exists(file): if os.path.exists(filename):
os.remove(file) os.remove(filename)
def rename(self, playlist, name): def rename(self, playlist, name):
if playlist not in self._playlists: if playlist not in self._playlists:
@ -171,12 +171,12 @@ class GStreamerStoredPlaylistsController(BaseStoredPlaylistsController):
file_path = os.path.join(self._folder, playlist.name + '.m3u') file_path = os.path.join(self._folder, playlist.name + '.m3u')
# FIXME this should be a save_m3u function, not inside save # FIXME this should be a save_m3u function, not inside save
with open(file_path, 'w') as file: with open(file_path, 'w') as file_handle:
for track in playlist.tracks: for track in playlist.tracks:
if track.uri.startswith('file://'): if track.uri.startswith('file://'):
file.write(track.uri[len('file://'):] + '\n') file_handle.write(track.uri[len('file://'):] + '\n')
else: else:
file.write(track.uri + '\n') file_handle.write(track.uri + '\n')
self._playlists.append(playlist) self._playlists.append(playlist)