Last active
January 16, 2016 15:05
-
-
Save infirit/abc983a5f951971af5ac to your computer and use it in GitHub Desktop.
dbusproxy subclass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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