mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 20:38:00 +01:00
Removed some unnecessary print statements. Added checks to the daemon and configscript.py to make sure the user opening it is root. Fixed formatting problems in class definitions in wicd.py
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
#!/usr/bin/python
|
|
|
|
#
|
|
# 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 <http://www.gnu.org/licenses/>.
|
|
#
|
|
|
|
import dbus
|
|
import time
|
|
|
|
bus = dbus.SystemBus()
|
|
proxy_obj = bus.get_object('org.wicd.daemon', '/org/wicd/daemon')
|
|
daemon = dbus.Interface(proxy_obj, 'org.wicd.daemon')
|
|
|
|
def reply_handle(r):
|
|
pass
|
|
def error_handle(e):
|
|
pass
|
|
|
|
print daemon.Hello()
|
|
time.sleep(3)
|
|
daemon.SetSuspend(False)
|
|
daemon.SetForcedDisconnect(False)
|
|
if not daemon.CheckIfConnecting():
|
|
print daemon.AutoConnect(True, reply_handler=reply_handle,
|
|
error_handler=error_handle)
|