fix E501 line too long
in lines with more than 145 characters
This commit is contained in:
parent
1407f22478
commit
4baaa75ee4
8 changed files with 61 additions and 20 deletions
|
@ -1,8 +1,8 @@
|
|||
[pycodestyle]
|
||||
count=1
|
||||
select = W1, W2, W3, E11, E121, E122, E123, E124, E125, E127, E129, E13, E2, E3, E401, E502, E703, E711, E712, E713, E721, E731, E74, E9
|
||||
select = W1, W2, W3, E11, E121, E122, E123, E124, E125, E127, E129, E13, E2, E3, E401, E5, E703, E711, E712, E713, E721, E731, E74, E9
|
||||
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
|
||||
max-line-length = 100
|
||||
max-line-length = 145
|
||||
|
||||
[isort]
|
||||
known_third_party=dbus,gi,mutagen,cairo,requests
|
||||
|
|
|
@ -128,9 +128,12 @@ class Database(object):
|
|||
with self.lock:
|
||||
cur = self.cursor()
|
||||
if podcast_id is not None:
|
||||
cur.execute('SELECT COUNT(*), state, is_new FROM %s WHERE podcast_id = ? GROUP BY state, is_new' % self.TABLE_EPISODE, (podcast_id,))
|
||||
cur.execute('SELECT COUNT(*), state, is_new FROM %s '
|
||||
'WHERE podcast_id = ? GROUP BY state, is_new'
|
||||
% self.TABLE_EPISODE, (podcast_id,))
|
||||
else:
|
||||
cur.execute('SELECT COUNT(*), state, is_new FROM %s GROUP BY state, is_new' % self.TABLE_EPISODE)
|
||||
cur.execute('SELECT COUNT(*), state, is_new FROM %s '
|
||||
'GROUP BY state, is_new' % self.TABLE_EPISODE)
|
||||
for count, state, is_new in cur:
|
||||
total += count
|
||||
if state == gpodder.STATE_DELETED:
|
||||
|
|
|
@ -177,7 +177,9 @@ class gPodderSyncUI(object):
|
|||
self.commit_changes_to_database()
|
||||
for current_channel in self.channels:
|
||||
# only sync those channels marked for syncing
|
||||
if (self._config.device_sync.device_type == 'filesystem' and current_channel.sync_to_mp3_player and self._config.device_sync.playlists.create):
|
||||
if (self._config.device_sync.device_type == 'filesystem'
|
||||
and current_channel.sync_to_mp3_player
|
||||
and self._config.device_sync.playlists.create):
|
||||
|
||||
# get playlist object
|
||||
playlist = gPodderDevicePlaylist(self._config,
|
||||
|
|
|
@ -306,7 +306,11 @@ def cairo_surface_to_pixbuf(s):
|
|||
# load. This happens in PyCairo < 1.1.6, see:
|
||||
# http://webcvs.cairographics.org/pycairo/NEWS?view=markup
|
||||
# Thanks to Chris Arnold for reporting this bug
|
||||
bio.write('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A\n/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cMEQkqIyxn3RkAAAAZdEVYdENv\nbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADUlEQVQI12NgYGBgAAAABQABXvMqOgAAAABJ\nRU5ErkJggg==\n'.decode('base64'))
|
||||
bio.write('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4'
|
||||
'c6QAAAAZiS0dEAP8A\n/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAA'
|
||||
'AAd0SU1FB9cMEQkqIyxn3RkAAAAZdEVYdENv\nbW1lbnQAQ3JlYXRlZCB3a'
|
||||
'XRoIEdJTVBXgQ4XAAAADUlEQVQI12NgYGBgAAAABQABXvMqOgAAAABJ\nRU'
|
||||
'5ErkJggg==\n'.decode('base64'))
|
||||
|
||||
pbl = GdkPixbuf.PixbufLoader()
|
||||
pbl.write(bio.getvalue())
|
||||
|
|
|
@ -1267,7 +1267,8 @@ class gPodder(BuilderWidget, dbus.service.Object):
|
|||
return self.download_list_update_enabled
|
||||
except Exception as e:
|
||||
logger.error('Exception happened while updating download list.', exc_info=True)
|
||||
self.show_message('%s\n\n%s' % (_('Please report this problem and restart gPodder:'), str(e)), _('Unhandled exception'), important=True)
|
||||
self.show_message('%s\n\n%s' % (_('Please report this problem and restart gPodder:'),
|
||||
str(e)), _('Unhandled exception'), important=True)
|
||||
# We return False here, so the update loop won't be called again,
|
||||
# that's why we require the restart of gPodder in the message.
|
||||
return False
|
||||
|
@ -1648,16 +1649,31 @@ class gPodder(BuilderWidget, dbus.service.Object):
|
|||
menu = Gtk.Menu()
|
||||
|
||||
if can_force:
|
||||
menu.append(make_menu_item(_('Start download now'), 'document-save', selected_tasks, download.DownloadTask.QUEUED, force_start=True))
|
||||
menu.append(make_menu_item(_('Start download now'), 'document-save',
|
||||
selected_tasks,
|
||||
download.DownloadTask.QUEUED,
|
||||
force_start=True))
|
||||
else:
|
||||
menu.append(make_menu_item(_('Download'), 'document-save', selected_tasks, download.DownloadTask.QUEUED, can_queue))
|
||||
menu.append(make_menu_item(_('Cancel'), 'media-playback-stop', selected_tasks, download.DownloadTask.CANCELLED, can_cancel))
|
||||
menu.append(make_menu_item(_('Pause'), 'media-playback-pause', selected_tasks, download.DownloadTask.PAUSED, can_pause))
|
||||
menu.append(make_menu_item(_('Download'), 'document-save',
|
||||
selected_tasks,
|
||||
download.DownloadTask.QUEUED,
|
||||
can_queue))
|
||||
|
||||
menu.append(make_menu_item(_('Cancel'), 'media-playback-stop',
|
||||
selected_tasks,
|
||||
download.DownloadTask.CANCELLED,
|
||||
can_cancel))
|
||||
menu.append(make_menu_item(_('Pause'), 'media-playback-pause',
|
||||
selected_tasks,
|
||||
download.DownloadTask.PAUSED, can_pause))
|
||||
menu.append(Gtk.SeparatorMenuItem())
|
||||
menu.append(make_menu_item(_('Move up'), 'go-up', action=move_selected_items_up))
|
||||
menu.append(make_menu_item(_('Move down'), 'go-down', action=move_selected_items_down))
|
||||
menu.append(make_menu_item(_('Move up'), 'go-up',
|
||||
action=move_selected_items_up))
|
||||
menu.append(make_menu_item(_('Move down'), 'go-down',
|
||||
action=move_selected_items_down))
|
||||
menu.append(Gtk.SeparatorMenuItem())
|
||||
menu.append(make_menu_item(_('Remove from list'), 'list-remove', selected_tasks, sensitive=can_remove))
|
||||
menu.append(make_menu_item(_('Remove from list'), 'list-remove',
|
||||
selected_tasks, sensitive=can_remove))
|
||||
|
||||
menu.attach_to_widget(treeview)
|
||||
menu.show_all()
|
||||
|
|
|
@ -80,9 +80,18 @@ class Importer(object):
|
|||
|
||||
if outline.getAttribute('xmlUrl') or outline.getAttribute('url'):
|
||||
channel = {
|
||||
'url': outline.getAttribute('xmlUrl') or outline.getAttribute('url'),
|
||||
'title': outline.getAttribute('title') or outline.getAttribute('text') or outline.getAttribute('xmlUrl') or outline.getAttribute('url'),
|
||||
'description': outline.getAttribute('text') or outline.getAttribute('xmlUrl') or outline.getAttribute('url'),
|
||||
'url':
|
||||
outline.getAttribute('xmlUrl')
|
||||
or outline.getAttribute('url'),
|
||||
'title':
|
||||
outline.getAttribute('title')
|
||||
or outline.getAttribute('text')
|
||||
or outline.getAttribute('xmlUrl')
|
||||
or outline.getAttribute('url'),
|
||||
'description':
|
||||
outline.getAttribute('text')
|
||||
or outline.getAttribute('xmlUrl')
|
||||
or outline.getAttribute('url'),
|
||||
}
|
||||
|
||||
if channel['description'] == channel['title']:
|
||||
|
|
|
@ -853,7 +853,11 @@ class MTPDevice(Device):
|
|||
needed = util.calculate_size(filename)
|
||||
free = self.get_free_space()
|
||||
if needed > free:
|
||||
logger.error('Not enough space on device %s: %s available, but need at least %s', self.get_name(), util.format_filesize(free), util.format_filesize(needed))
|
||||
logger.error('Not enough space on device %s: %s available, but '
|
||||
'need at least %s',
|
||||
self.get_name(),
|
||||
util.format_filesize(free),
|
||||
util.format_filesize(needed))
|
||||
self.cancelled = True
|
||||
return False
|
||||
|
||||
|
|
|
@ -1998,8 +1998,11 @@ class Popen(subprocess.Popen):
|
|||
if gpodder.ui.win32 and kwargs['close_fds']:
|
||||
if [(k, v) for (k, v) in kwargs.items() if k in ('stdin', 'stdout', 'stderr') and v]:
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.error('util.Popen(close_fds=True) is incompatible with stream redirection on Windows.')
|
||||
logger.error('With close_fds=False, the process keeps all currently open files locked. It might be tolerable for short-lived commands. Or use temp files.')
|
||||
logger.error('util.Popen(close_fds=True) is incompatible with'
|
||||
' stream redirection on Windows.')
|
||||
logger.error('With close_fds=False, the process keeps all '
|
||||
'currently open files locked. It might be tolerable '
|
||||
'for short-lived commands. Or use temp files.')
|
||||
|
||||
raise e
|
||||
|
||||
|
|
Loading…
Reference in a new issue