1
# ubuntuone.syncdaemon.platform.notification - User Notification
3
# Author: Eric Casteleijn <eric.casteleijn@canonical.com>
5
# Copyright 2011 Canonical Ltd.
7
# This program is free software: you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License version 3, as published
9
# by the Free Software Foundation.
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranties of
13
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
# PURPOSE. See the GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License along
17
# with this program. If not, see <http://www.gnu.org/licenses/>.
18
"""Module that implements notification of the end user."""
22
from ubuntuone.status.notification import AbstractNotification
24
APPLICATION_NAME = 'Ubuntu One Client'
27
class Notification(AbstractNotification):
28
"""Notification of the end user."""
30
def __init__(self, application_name=APPLICATION_NAME):
31
self.application_name = application_name
33
def send_notification(self, title, message, icon=None, append=False):
34
"""Send a notification using the underlying library."""
35
pynotify.init(self.application_name)
36
notification = pynotify.Notification(title, message, icon)
38
notification.set_hint_string('append', '')