#!/usr/bin/python """ Suspends the wicd daemon. Sets a flag in the daemon that will stop it from monitoring networkg status. Used for when a laptop enters hibernation/suspension. """ # # Copyright (C) 2007 Adam Blackburn # Copyright (C) 2007 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as # published by the Free Software Foundation. # # This program 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 . # import dbus import dbus.service bus = dbus.SystemBus() proxy_obj = bus.get_object('org.wicd.daemon', '/org/wicd/daemon') daemon = dbus.Interface(proxy_obj, 'org.wicd.daemon') if __name__ == '__main__': daemon.Disconnect() daemon.SetForcedDisconnect(False) daemon.SetSuspend(True)