mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 04:48:00 +01:00
Made calls to Autoconnect outside the daemon asynchronous.
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
This commit is contained in:
@@ -24,8 +24,15 @@ 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)
|
||||
if daemon.CheckIfConnecting() == False:
|
||||
print daemon.AutoConnect(True)
|
||||
daemon.SetForcedDisconnect(False)
|
||||
if not daemon.CheckIfConnecting():
|
||||
print daemon.AutoConnect(True, reply_handler=reply_handle,
|
||||
error_handler=error_handle)
|
||||
|
||||
Reference in New Issue
Block a user