fix W391 blank line at end of file

This commit is contained in:
MarkusHackspacher 2018-02-11 21:51:40 +01:00
parent 750e11dc7b
commit a90fa0b521
70 changed files with 1 additions and 76 deletions

View File

@ -1,5 +1,5 @@
[pycodestyle]
count=1
select = W1, W2, E114, E115, E125, E129, E211, E222, E227, E266, E271, E272, E3, E703, E711, E712, E713, E721, E9
select = W1, W2, W3, E114, E115, E125, E129, E211, E222, E227, E266, E271, E272, E3, E703, E711, E712, E713, E721, E9
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
max-line-length = 100

View File

@ -207,4 +207,3 @@ setup(
scripts = scripts,
data_files = data_files,
)

View File

@ -34,4 +34,3 @@ interface = dbus.Interface(proxy, gpodder.dbus_interface)
if not interface.mark_episode_played(filename):
print('Warning: Could not mark episode as played.', file=sys.stderr)
sys.exit(2)

View File

@ -99,4 +99,3 @@ class gPodderExtension:
return None
return [(_('Concatenate videos'), self._concatenate_videos)]

View File

@ -122,4 +122,3 @@ class gPodderExtension:
self.status_icon.set_from_pixbuf(icon)
self.last_progress = progress

View File

@ -317,4 +317,3 @@ class gPodderExtension:
def on_unload(self):
self.notifier.remove_from_connection(self.session_bus, self.path)
self.rcvr.stop_receiving()

View File

@ -105,4 +105,3 @@ class gPodderExtension:
def convert_episodes(self, episodes):
for episode in episodes:
self._convert_episode(episode)

View File

@ -117,4 +117,3 @@ class gPodderExtension(object):
def on_unload(self):
if self.notifier is not None:
self.notifier.remove()

View File

@ -69,4 +69,3 @@ else:
except:
# See http://gpodder.org/bug/966
pass

View File

@ -66,4 +66,3 @@ class gPodderExtension:
# Avoid filename collisions
if not os.path.exists(filename):
return filename

View File

@ -97,4 +97,3 @@ class gPodderExtension:
ogg.save()
except Exception as e:
logger.warn('Failed to remove OGG cover: %s', e, exc_info=True)

View File

@ -40,4 +40,3 @@ class gPodderExtension:
logger.info('Syncing cover art for %s', episode.channel.title)
# copy and rename art
shutil.copy(episode_art, device_art)

View File

@ -181,4 +181,3 @@ class gPodderExtension:
int(progress * 100), 100)
else:
self.taskbar.SetProgressState(self.window_handle, TBPF_NOPROGRESS)

View File

@ -110,4 +110,3 @@ class gPodderExtension(object):
srt_filename = self.get_srt_filename(filename)
if os.path.exists(srt_filename):
os.remove(srt_filename)

View File

@ -71,4 +71,3 @@ class gPodderExtension:
if name == 'gpodder-gtk':
self.gpodder = ui_object
self._rebuild_menu()

View File

@ -103,4 +103,3 @@ else:
reader.read()
loop.quit()

View File

@ -116,4 +116,3 @@ class gPodderExtension:
def _convert_episodes(self, episodes):
for episode in episodes:
self._convert_episode(episode)

View File

@ -133,4 +133,3 @@ def get_expired_episodes(channels, config):
continue
yield episode

View File

@ -390,4 +390,3 @@ class Config(object):
name = gPodderSettings_LegacySupport[name]
setattr(self.__json_config, name, value)

View File

@ -58,4 +58,3 @@ class Core(object):
# Close the database and store outstanding changes
self.db.close()

View File

@ -119,4 +119,3 @@ class CoverDownloader(object):
def _fallback_filename(self, title):
return self._default_filename('podcast-%d.png' % (hash(title)%5))

View File

@ -281,4 +281,3 @@ class Database(object):
cur = self.cursor()
cur.execute('DELETE FROM %s WHERE podcast_id = ? AND guid = ?' %
self.TABLE_EPISODE, (podcast_id, guid))

View File

@ -147,4 +147,3 @@ class DBusPodcastsProxy(dbus.service.Object):
def check_for_updates(self):
"""Check for new episodes or offer subscriptions"""
self._on_check_for_updates()

View File

@ -886,4 +886,3 @@ class DownloadTask(object):
# We finished, but not successfully (at least not really)
return False

View File

@ -75,7 +75,3 @@ def update_using_feedservice(podcasts):
parsed_episodes = [parse_entry(podcast, entry) for entry in feed['episodes']]
# ...

View File

@ -16,4 +16,3 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

View File

@ -149,4 +149,3 @@ class GtkBuilderWidget(object):
after a program is finished by pressing Control-C.
"""
pass

View File

@ -181,4 +181,3 @@ class UIConfig(config.Config):
window.show()
if cfg.maximized:
window.maximize()

View File

@ -16,4 +16,3 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

View File

@ -219,4 +219,3 @@ class gPodderChannel(BuilderWidget):
self.update_podcast_list_model(selected=True,
sections_changed=section_changed)

View File

@ -112,4 +112,3 @@ class gPodderDevicePlaylist(object):
fp.write(filename)
fp.write(self.linebreak)
fp.close()

View File

@ -421,4 +421,3 @@ class gPodderEpisodeSelector(BuilderWidget):
self.gPodderEpisodeSelector.destroy()
if self.callback is not None:
self.callback([])

View File

@ -311,4 +311,3 @@ class gPodderSyncUI(object):
# 2. Check for free space (in UI thread)
# 3. Sync the device (in UI thread)
util.run_in_background(cleanup_episodes)

View File

@ -40,4 +40,3 @@ class gPodderWelcome(BuilderWidget):
def on_btnCancel_clicked(self, button):
self.main_window.response(Gtk.ResponseType.CANCEL)

View File

@ -216,4 +216,3 @@ class UserAppsReader(object):
if app.is_mime(mimetype):
model.insert_app(app.get_icon(), app.name, app.cmd)
return model

View File

@ -181,5 +181,3 @@ class DownloadTaskMonitor(object):
elif task.status in (task.QUEUED, task.DOWNLOADING):
self._on_can_pause()
self._status = task.status

View File

@ -16,4 +16,3 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

View File

@ -90,4 +90,3 @@ class gPodderAddPodcast(BuilderWidget):
if self.add_podcast_list is not None:
title = None # FIXME: Add title GUI element
self.add_podcast_list([(title, url)])

View File

@ -295,4 +295,3 @@ class TreeViewHelper(object):
return (x, y, True)
return position_func

View File

@ -108,4 +108,3 @@ class gPodderConfigEditor(BuilderWidget):
def on_gPodderConfigEditor_destroy(self, widget):
self.model.stop_observing()

View File

@ -114,4 +114,3 @@ class ProgressIndicator(object):
if self.dialog is not None:
self.dialog.destroy()
GObject.source_remove(self.source_id)

View File

@ -104,4 +104,3 @@ class TagCloud(Gtk.Layout):
GObject.type_register(TagCloud)

View File

@ -111,4 +111,3 @@ def register_handlers(gp):
""" register the events handlers (and keep a reference to gPodder's instance)"""
if handler is not None:
handler.register(gp)

View File

@ -3762,4 +3762,3 @@ def main(options=None):
gp = gPodderApplication(options)
gp.run()
sys.exit(0)

View File

@ -904,4 +904,3 @@ class PodcastListModel(Gtk.ListStore):
if row[self.C_URL] == channel.url:
row[self.C_COVER] = pixbuf
break

View File

@ -135,4 +135,3 @@ class CoverDownloader(ObservableService):
self.notify('cover-available', channel, pixbuf)
else:
return (channel.url, pixbuf)

View File

@ -129,4 +129,3 @@ class SpinningProgressIndicator(Gtk.Image):
if self._frame_id >= len(self._frames):
self._frame_id = 0
self.set_from_pixbuf(self._frames[self._frame_id])

View File

@ -225,4 +225,3 @@ class JsonConfig(object):
if target is None or not isinstance(target, dict):
target_dict[attr] = target = {}
target_dict = target

View File

@ -86,4 +86,3 @@ def setup(verbose=True):
for name in ('cli', 'gtk') if getattr(gpodder.ui, name, False)))
return True

View File

@ -225,4 +225,3 @@ if __name__ == '__main__':
# A schema update takes place here
m.save(Person('User %d' % x, x*20, 'user@home.com') for x in range(50))
print(m.load(Person))

View File

@ -1261,4 +1261,3 @@ class Model(object):
Returns a iterable, sorted sequence of the episodes
"""
return sorted(episodes, key=cls.episode_sort_key, reverse=reverse)

View File

@ -665,4 +665,3 @@ class Directory(object):
return [(p.title or p.url, p.url)
for p in self.client.search_podcasts(query)
if p.url]

View File

@ -195,4 +195,3 @@ class Exporter(object):
return False
return True

View File

@ -81,4 +81,3 @@ class MediaPlayerDBusReceiver(object):
if file_uri.startswith('/'):
file_uri = 'file://' + urllib.parse.quote(file_uri)
self.on_play_event(start, end, total, file_uri)

View File

@ -253,4 +253,3 @@ model.register_custom_handler(SoundcloudFavFeed)
def search_for_user(query):
json_url = 'https://api.soundcloud.com/users.json?q=%s&consumer_key=%s' % (urllib.parse.quote(query), CONSUMER_KEY)
return json.loads(util.urlopen(json_url).read().decode('utf-8'))

View File

@ -175,5 +175,3 @@ def UserEQL(query):
return EQL("'%s'" % query)
else:
return EQL(query)

View File

@ -323,4 +323,3 @@ def check_data(db):
'WHERE podcast_id NOT IN (SELECT id FROM podcast)')
if orphan_episodes > 0:
logger.error('Orphaned episodes found in database')

View File

@ -61,5 +61,3 @@ class ObservableService(object):
return True
return False

View File

@ -1102,4 +1102,3 @@ class SyncTask(download.DownloadTask):
# We finished, but not successfully (at least not really)
return False

View File

@ -51,4 +51,3 @@ class TestEpisodePublishedProperties(unittest.TestCase):
def test_pubdate_day(self):
self.assertEqual(self.episode.pubdate_day, self.PUBLISHED_DAY)

View File

@ -117,4 +117,3 @@ def get_real_channel_url(url):
def get_real_cover(url):
return None

View File

@ -14,4 +14,3 @@ class SessionBus(object):
SystemBus = SessionBus

View File

@ -4,4 +4,3 @@ class DBusException(Exception):
class NameExistsException(Exception):
pass

View File

@ -2,4 +2,3 @@
class DBusGMainLoop(object):
def __init__(self, *args, **kwargs):
pass

View File

@ -11,4 +11,3 @@ class BusName(object):
class Object:
def __init__(self, *args, **kwargs):
pass

View File

@ -60,4 +60,3 @@ for language in sorted(languages):
print("""
Total translations: %s
""" % (len(languages)))

View File

@ -63,4 +63,3 @@ for module, required_files in MODULES:
shutil.move(os.path.join(tmp_dir, name), target_file)
shutil.rmtree(tmp_dir)

View File

@ -32,4 +32,3 @@ for y in range(1):
w.set_default_size(400, 100)
w.show_all()
Gtk.main()

View File

@ -120,4 +120,3 @@ if __name__ == '__main__':
""" % locals())
while True:
httpd.handle_request()