wireless support. duh.

This commit is contained in:
brent s
2019-11-10 05:39:33 -05:00
parent f68069a25e
commit 012865a6b1
9 changed files with 165 additions and 61 deletions

16
aif/network/__init__.py Normal file
View File

@@ -0,0 +1,16 @@
try:
from . import _common
except ImportError:
pass # GI isn't supported, so we don't even use a fallback.
# TODO: use DBus interface for systemd but fallback to subprocess?
# http://0pointer.net/blog/the-new-sd-bus-api-of-systemd.html
# https://www.youtube.com/watch?v=ZUX9Fx8Rwzg
# https://www.youtube.com/watch?v=lBQgMGPxqNo
# https://github.com/facebookincubator/pystemd has some unit/service examples
# try:
# from . import networkd
# except ImportError:
# from . import networkd_fallback as networkd
from . import netctl

13
aif/network/_common.py Normal file
View File

@@ -0,0 +1,13 @@
import gi
gi.require_version('NM', '2.0')
from gi.repository import NM, GLib
NM.ensure_init([None])
def addBDPlugin(plugin_name):
plugins = NM.get_available_plugin_names()
plugins.append(plugin_name)
plugins = list(set(plugins)) # Deduplicate
spec = NM.plugin_specs_from_names(plugins)
return(NM.ensure_init(spec))

0
aif/network/netctl.py Normal file
View File

4
aif/network/networkd.py Normal file
View File

@@ -0,0 +1,4 @@
import ipaddress
import socket

View File

View File

View File