Skip to content

Commit

Permalink
Fix linting issues from gpodder#1054
Browse files Browse the repository at this point in the history
  • Loading branch information
auouymous committed Jul 28, 2021
1 parent 8f9159e commit 106e2f4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/gpodder/gtkui/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

_ = gpodder.gettext


class TaskQueue:
def __init__(self):
self.lock = threading.Lock()
Expand Down Expand Up @@ -81,6 +82,7 @@ def move_before(self, task, before):
except ValueError:
pass


class DownloadStatusModel:
# Symbolic names for our columns, so we know what we're up to
C_TASK, C_NAME, C_URL, C_PROGRESS, C_PROGRESS_TEXT, C_ICON_NAME = list(range(6))
Expand Down Expand Up @@ -220,6 +222,7 @@ def set_downloading(self, task):
task.status = task.DOWNLOADING
return True


class DownloadTaskMonitor(object):
"""A helper class that abstracts download events"""
def __init__(self, episode, on_can_resume, on_can_pause, on_finished):
Expand Down
3 changes: 1 addition & 2 deletions src/gpodder/gtkui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,7 @@ def update_downloads_list(self, can_call_cleanup=True):
title.append(N_('%(queued)d task queued',
'%(queued)d tasks queued',
queued) % {'queued': queued})
if ((downloading + synchronizing + queued) == 0 and
self.things_adding_tasks == 0):
if (downloading + synchronizing + queued) == 0 and self.things_adding_tasks == 0:
self.set_download_progress(1.)
self.downloads_finished(self.download_tasks_seen)
gpodder.user_extensions.on_all_episodes_downloaded()
Expand Down
4 changes: 3 additions & 1 deletion src/gpodder/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ def set_podcast_flags(self, track, episode):
except:
logger.warning('Seems like your python-gpod is out-of-date.')


class MP3PlayerDevice(Device):
def __init__(self, config,
download_status_model,
Expand Down Expand Up @@ -597,7 +598,8 @@ def add_track(self, episode, reporthook=None):
to_file.get_uri())
from_file = Gio.File.new_for_path(from_file)
try:
hookconvert = lambda current_bytes, total_bytes, user_data : reporthook(current_bytes, 1, total_bytes)
def hookconvert(current_bytes, total_bytes, user_data):
return reporthook(current_bytes, 1, total_bytes)
from_file.copy(to_file, Gio.FileCopyFlags.OVERWRITE, None, hookconvert, None)
except GLib.Error as err:
logger.error('Error copying %s to %s: %s', from_file.get_uri(), to_file.get_uri(), err.message)
Expand Down
3 changes: 1 addition & 2 deletions src/gpodder/syncui.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ def sync_thread_func():
# if playlist doesn't exist (yet) episodes_in_playlist will be empty
if episodes_in_playlists:
for episode_filename in episodes_in_playlists:
if not playlist.mountpoint.resolve_relative_path(
episode_filename).query_exists():
if not playlist.mountpoint.resolve_relative_path(episode_filename).query_exists():
# episode was synced but no longer on device
# i.e. must have been deleted by user, so delete from gpodder
try:
Expand Down
4 changes: 2 additions & 2 deletions src/gpodder/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

import gi
gi.require_version('Gtk', '3.0') # isort:skip
from gi.repository import Gio, GLib, Gtk # isort:skip
from gi.repository import Gio, GLib, Gtk # isort:skip

import requests
import requests.exceptions
Expand Down Expand Up @@ -2259,7 +2259,7 @@ def response_text(response, default_encoding='utf-8'):
return response.content.decode(default_encoding)


def mount_volume_for_file(file, op = None):
def mount_volume_for_file(file, op=None):
"""
Utility method to mount the enclosing volume for the given file in a blocking
fashion
Expand Down

0 comments on commit 106e2f4

Please sign in to comment.