Fix E502 the backslash is redundant between brackets

This commit is contained in:
MarkusHackspacher 2018-05-08 11:41:52 +02:00
parent 158210c961
commit 005b9615f5
3 changed files with 27 additions and 27 deletions

View File

@ -1393,8 +1393,8 @@ class gPodder(BuilderWidget, dbus.service.Object):
# assume we don't want to operate on the selection
paths = []
if path is not None and not paths and
event.button == 3:
if (path is not None and not paths and
event.button == 3):
# No selection or clicked outside selection;
# select the single item where we clicked
treeview.grab_focus()
@ -3049,7 +3049,7 @@ class gPodder(BuilderWidget, dbus.service.Object):
def on_download_subscriptions_from_mygpo(self, action=None):
def after_login():
title = _('Subscriptions on %(server)s')
title = _('Subscriptions on %(server)s') \
% {'server': self.config.mygpo.server}
dir = gPodderPodcastDirectory(self.gPodder,
_config=self.config,
@ -3367,8 +3367,8 @@ class gPodder(BuilderWidget, dbus.service.Object):
GObject.source_remove(self._auto_update_timer_source_id)
self._auto_update_timer_source_id = None
if self.config.auto_update_feeds and
self.config.auto_update_frequency:
if (self.config.auto_update_feeds and
self.config.auto_update_frequency):
interval = 60 * 1000 * self.config.auto_update_frequency
logger.debug('Setting up auto update timer with interval %d.',
self.config.auto_update_frequency)

View File

@ -148,12 +148,12 @@ class BackgroundUpdate(object):
class EpisodeListModel(Gtk.ListStore):
C_URL, C_TITLE, C_FILESIZE_TEXT, C_EPISODE, C_STATUS_ICON,
C_PUBLISHED_TEXT, C_DESCRIPTION, C_TOOLTIP,
C_VIEW_SHOW_UNDELETED, C_VIEW_SHOW_DOWNLOADED,
C_VIEW_SHOW_UNPLAYED, C_FILESIZE, C_PUBLISHED,
C_TIME, C_TIME_VISIBLE, C_TOTAL_TIME,
C_LOCKED = list(range(17))
C_URL, C_TITLE, C_FILESIZE_TEXT, C_EPISODE, C_STATUS_ICON, \
C_PUBLISHED_TEXT, C_DESCRIPTION, C_TOOLTIP, \
C_VIEW_SHOW_UNDELETED, C_VIEW_SHOW_DOWNLOADED, \
C_VIEW_SHOW_UNPLAYED, C_FILESIZE, C_PUBLISHED, \
C_TIME, C_TIME_VISIBLE, C_TOTAL_TIME, \
C_LOCKED = list(range(17))
VIEW_ALL, VIEW_UNDELETED, VIEW_DOWNLOADED, VIEW_UNPLAYED = list(range(4))
@ -514,11 +514,11 @@ class PodcastChannelProxy(object):
class PodcastListModel(Gtk.ListStore):
C_URL, C_TITLE, C_DESCRIPTION, C_PILL, C_CHANNEL,
C_COVER, C_ERROR, C_PILL_VISIBLE,
C_VIEW_SHOW_UNDELETED, C_VIEW_SHOW_DOWNLOADED,
C_VIEW_SHOW_UNPLAYED, C_HAS_EPISODES, C_SEPARATOR,
C_DOWNLOADS, C_COVER_VISIBLE, C_SECTION = list(range(16))
C_URL, C_TITLE, C_DESCRIPTION, C_PILL, C_CHANNEL, \
C_COVER, C_ERROR, C_PILL_VISIBLE, \
C_VIEW_SHOW_UNDELETED, C_VIEW_SHOW_DOWNLOADED, \
C_VIEW_SHOW_UNPLAYED, C_HAS_EPISODES, C_SEPARATOR, \
C_DOWNLOADS, C_COVER_VISIBLE, C_SECTION = list(range(16))
SEARCH_COLUMNS = (C_TITLE, C_DESCRIPTION, C_SECTION)

View File

@ -47,8 +47,8 @@ mygpoclient.user_agent += ' ' + gpodder.user_agent
# 2013-02-08: We should update this to 1.7 once we use the new features
MYGPOCLIENT_REQUIRED = '1.4'
if not hasattr(mygpoclient, 'require_version') or
not mygpoclient.require_version(MYGPOCLIENT_REQUIRED):
if (not hasattr(mygpoclient, 'require_version')
or not mygpoclient.require_version(MYGPOCLIENT_REQUIRED)):
print("""
Please upgrade your mygpoclient library.
See http://thp.io/2010/mygpoclient/
@ -143,7 +143,7 @@ class EpisodeAction(object):
'action': str, 'timestamp': int,
'started': int, 'position': int, 'total': int}
def __init__(self, podcast_url, episode_url, device_id, \
def __init__(self, podcast_url, episode_url, device_id,
action, timestamp, started, position, total):
self.podcast_url = podcast_url
self.episode_url = episode_url
@ -212,8 +212,8 @@ class MygPoClient(object):
self._store.remove(self._store.load(UpdateDeviceAction))
# Insert our new update action
action = UpdateDeviceAction(self.device_id, \
self._config.mygpo.device.caption, \
action = UpdateDeviceAction(self.device_id,
self._config.mygpo.device.caption,
self._config.mygpo.device.type)
self._store.save(action)
@ -343,13 +343,13 @@ class MygPoClient(object):
raise Exception('Webservice access not enabled')
def _convert_played_episode(self, episode, start, end, total):
return EpisodeAction(episode.channel.url, \
episode.url, self.device_id, 'play', \
return EpisodeAction(episode.channel.url,
episode.url, self.device_id, 'play',
int(time.time()), start, end, total)
def _convert_episode(self, episode, action):
return EpisodeAction(episode.channel.url, \
episode.url, self.device_id, action, \
return EpisodeAction(episode.channel.url,
episode.url, self.device_id, action,
int(time.time()), None, None, None)
def on_delete(self, episodes):
@ -489,8 +489,8 @@ class MygPoClient(object):
try:
# Load the "since" value from the database
since_o = self._store.get(SinceValue, host=self.host, \
device_id=self.device_id, \
since_o = self._store.get(SinceValue, host=self.host,
device_id=self.device_id,
category=SinceValue.EPISODES)
# Use a default since object for the first-time case