def on_load(self, container): self.Builder = Gtk.Builder() self.Builder.set_translation_domain("blueman") bind_textdomain_codeset("blueman", "UTF-8") self.Builder.add_from_file(UI_PATH + "/services-network.ui") self.widget = self.Builder.get_object("network_frame") container.pack_start(self.widget, True, True, 0) self.interfaces = [] for iface in get_net_interfaces(): if iface != "lo" and iface != "pan1": logging.info(iface) ip = inet_aton(get_net_address(iface)) mask = inet_aton(get_net_netmask(iface)) self.interfaces.append( (iface, ip, mask, mask_ip4_address(ip, mask))) self.setup_network() try: self.ip_check() except Exception as e: logging.exception(e) return (_("Network"), "network-workgroup")
def on_load(self, container): self.Builder = Gtk.Builder() self.Builder.set_translation_domain("blueman") self.Builder.add_from_file(UI_PATH + "/services-network.ui") self.widget = self.Builder.get_object("network") container.pack_start(self.widget, True, True, 0) self.interfaces = [] for iface in get_net_interfaces(): if iface != "lo" and iface != "pan1": print(iface) ip = inet_aton(get_net_address(iface)) mask = inet_aton(get_net_netmask(iface)) self.interfaces.append((iface, ip, mask, mask_ip4_address(ip, mask))) self.setup_network() try: self.ip_check() except: pass return (_("Network"), "network-workgroup")
def on_load(self, container): self.Builder = Gtk.Builder() self.Builder.set_translation_domain("blueman") bind_textdomain_codeset("blueman", "UTF-8") self.Builder.add_from_file(UI_PATH + "/services-network.ui") self.widget = self.Builder.get_object("network_frame") container.pack_start(self.widget, True, True, 0) self.interfaces = [] for iface in get_net_interfaces(): if iface != "lo" and iface != "pan1": logging.info(iface) ipiface = ipaddress.ip_interface('/'.join((get_net_address(iface), get_net_netmask(iface)))) self.interfaces.append((iface, ipiface)) self.setup_network() try: self.ip_check() except (ValueError, ipaddress.AddressValueError) as e: logging.exception(e) return _("Network"), "network-workgroup"