/usr/share/gpodder/extensions/notification.py is in gpodder 3.10.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2011 Thomas Perl and the gPodder Team
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# gPodder is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Bernd Schlapsi <brot@gmx.info>; 2011-11-20
__title__ = 'Gtk+ Desktop Notifications'
__description__ = 'Display notification bubbles for different events.'
__category__ = 'desktop-integration'
__only_for__ = 'gtk'
__mandatory_in__ = 'gtk'
__disable_in__ = 'win32'
import gpodder
import logging
logger = logging.getLogger(__name__)
try:
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
pynotify = True
except ImportError:
pynotify = None
except ValueError:
pynotify = None
if pynotify is None:
class gPodderExtension(object):
def __init__(self, container):
logger.info('Could not find PyNotify.')
else:
class gPodderExtension(object):
def __init__(self, container):
self.container = container
def on_load(self):
Notify.init('gPodder')
def on_unload(self):
Notify.uninit()
def on_notification_show(self, title, message):
if not message and not title:
return
notify = Notify.Notification.new(title or '', message or '',
gpodder.icon_file)
try:
notify.show()
except:
# See http://gpodder.org/bug/966
pass
|