def __init__(self, default_ip, default_netmask): if not default_ip: default_ip = get_default_ip() if not default_netmask: default_netmask = NetUtils.get_netmask() net_detect = NetworkDetect(default_ip, default_netmask) network_address = net_detect.network self.default_network = [(network_address, default_netmask)]
def __init__(self, default_ip, default_netmask): if not default_ip : default_ip = get_default_ip() if not default_netmask : default_netmask = NetUtils.get_netmask() net_detect = NetworkDetect(default_ip, default_netmask) network_address = net_detect.network self.default_network = [(network_address, default_netmask)]
def __init__(self, resolve_order, ip=None, netmask=None): """ @param resolv_order: list of methods to apply @type resolv_order: list @param ip: IP address of server @type ip: str @param netmask: netmask of relevant network @type netmask: str """ self.resolve_order = resolve_order if not ip : ip = get_default_ip() if not netmask : netmask, gateway = NetUtils.get_netmask_and_gateway() self.ip = ip or get_default_ip() self.netmask = netmask self.register_resolvers(resolve_order)