Skip to content

Instantly share code, notes, and snippets.

@infirit
Last active January 16, 2016 15:05
Show Gist options
  • Select an option

  • Save infirit/abc983a5f951971af5ac to your computer and use it in GitHub Desktop.

Select an option

Save infirit/abc983a5f951971af5ac to your computer and use it in GitHub Desktop.
dbusproxy subclass
from gi.repository import Gio, GLib, GObject
class TestProxy(Gio.DBusProxy):
__bus = Gio.bus_get_sync(Gio.BusType.SYSTEM)
def __init__(self, name, obj_path, interface):
super(TestProxy, self).__init__(
g_connection=self.__bus,
g_flags=Gio.DBusProxyFlags.NONE,
g_interface_info=None,
g_name=name,
g_object_path=obj_path,
g_interface_name=interface)
myproxy = TestProxy(
"org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager/Devices/0",
"org.freedesktop.NetworkManager.Device")
print(myproxy.get_cached_property("Interface"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment