1
# -*- coding: utf-8 -*-
3
# Author: Rodney Dawes <rodney.dawes@canonical.com>
5
# Copyright 2009 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/>.
20
CHANGEUP_BUS_NAME = 'org.freedesktop.ChangeUp'
23
def register_restart_handler(appname, handler):
24
"""Register a restart handler for ChangeUp."""
25
def restart_handler(app):
29
bus = dbus.SystemBus()
30
bus.add_signal_receiver(handler_function=restart_handler,
31
signal_name='RestartDispatched',
32
dbus_interface=CHANGEUP_BUS_NAME)