# Path: pyanaconda/constants.py
# DEFAULT_DBUS_TIMEOUT = -1       # use default


from gi.repository import Gio, GLib
from gi.repository import NetworkManager
from pyanaconda.constants import DEFAULT_DBUS_TIMEOUT
import IPy
import struct
import socket
import re

class UnknownMethodGetError(Exception):
    """Object does not have Get, most probably being invalid"""
    def __str__(self):
        return self.__repr__()

def _get_proxy(bus_type=Gio.BusType.SYSTEM,
               flags=Gio.DBusProxyFlags.NONE,
               info=None,
               name="org.freedesktop.NetworkManager",
               object_path="/org/freedesktop/NetworkManager",
               interface_name="org.freedesktop.NetworkManager",
               cancellable=None):
    proxy = Gio.DBusProxy.new_for_bus_sync(bus_type,
                                           flags,
                                           info,
                                           name,
                                           object_path,
                                           interface_name,
                                           cancellable)
    return proxy

def _get_property(object_path, prop, interface_name_suffix=""):
    interface_name = "org.freedesktop.NetworkManager" + interface_name_suffix
    proxy = _get_proxy(object_path=object_path, interface_name="org.freedesktop.DBus.Properties")
    args = GLib.Variant('(ss)', (interface_name, prop))
    try:
        prop = proxy.call_sync("Get",
                                args,
                                Gio.DBusCallFlags.NONE,

# Path: pyanaconda/constants.py
# DEFAULT_DBUS_TIMEOUT = -1       # use default


# Path: pyanaconda/nm.py
from gi.repository import Gio, GLib
from gi.repository import NetworkManager
from pyanaconda.constants import DEFAULT_DBUS_TIMEOUT
import IPy
import struct
import socket
import re


class UnknownMethodGetError(Exception):
    """Object does not have Get, most probably being invalid"""
    def __str__(self):
        return self.__repr__()

def _get_proxy(bus_type=Gio.BusType.SYSTEM,
               flags=Gio.DBusProxyFlags.NONE,
               info=None,
               name="org.freedesktop.NetworkManager",
               object_path="/org/freedesktop/NetworkManager",
               interface_name="org.freedesktop.NetworkManager",
               cancellable=None):
    proxy = Gio.DBusProxy.new_for_bus_sync(bus_type,
                                           flags,
                                           info,
                                           name,
                                           object_path,
                                           interface_name,
                                           cancellable)
    return proxy

def _get_property(object_path, prop, interface_name_suffix=""):
    interface_name = "org.freedesktop.NetworkManager" + interface_name_suffix
    proxy = _get_proxy(object_path=object_path, interface_name="org.freedesktop.DBus.Properties")
    args = GLib.Variant('(ss)', (interface_name, prop))
    try:
        prop = proxy.call_sync("Get",
                                args,
                                Gio.DBusCallFlags.NONE,

                                DEFAULT_DBUS_TIMEOUT,