mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-19 18:22:32 +01:00
auto-t: Optionally start iwd from python lib
This commit is contained in:
parent
5d7f523bbf
commit
d429d78940
@ -483,10 +483,24 @@ class IWD(AsyncOpAbstract):
|
|||||||
_agent_manager_if = None
|
_agent_manager_if = None
|
||||||
_known_network_manager_if = None
|
_known_network_manager_if = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, start_iwd_daemon = False):
|
||||||
global mainloop
|
global mainloop
|
||||||
mainloop = GLib.MainLoop()
|
mainloop = GLib.MainLoop()
|
||||||
|
|
||||||
|
if not start_iwd_daemon:
|
||||||
|
return
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
iwd_proc = subprocess.Popen('iwd')
|
||||||
|
|
||||||
|
tries = 0
|
||||||
|
while not self._bus.name_has_owner(IWD_SERVICE):
|
||||||
|
if tries > 20:
|
||||||
|
iwd_proc.terminate()
|
||||||
|
raise TimeoutError('IWD has failed to start')
|
||||||
|
tries += 1
|
||||||
|
time.sleep(0.05)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _object_manager(self):
|
def _object_manager(self):
|
||||||
if self._object_manager_if is None:
|
if self._object_manager_if is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user