Skip to content

Commit

Permalink
Extension: Open website in episode list (bug 1958)
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Oct 30, 2014
1 parent 115ed61 commit 823143c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions share/gpodder/extensions/episode_website_context_menu.py
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Add a context menu to show the episode website (bug 1958)
# (c) 2014-10-20 Thomas Perl <thp.io/about>
# Released under the same license terms as gPodder itself.

import gpodder
from gpodder import util

import logging
logger = logging.getLogger(__name__)

_ = gpodder.gettext

__title__ = _('"Open website" episode context menu')
__description__ = _('Add a context menu item for opening the website of an episode')
__authors__ = 'Thomas Perl <thp@gpodder.org>'
__category__ = 'interface'
__only_for__ = 'gtk'


class gPodderExtension:
def __init__(self, container):
self.container = container

def open_website(self, episodes):
for episode in episodes:
util.open_website(episode.link)

def on_episodes_context_menu(self, episodes):
return [(_('Open website'), self.open_website)]

0 comments on commit 823143c

Please sign in to comment.