def _del_net(self): sel = self.netlist.get(Tix.ANCHOR) if not sel: return netid = sel.split('[', 1)[1].split(']', 1)[0] net = _k.networks[netid] r = tkMessageBox.askyesno("Warning", """\ Deleting a network configuration cannot be undone. Are you sure you want to delete %s?""" % net.name) if r: del _k.networks[netid] _k.save_networks() _kc.save() self.refresh_netlist()
def save_networks(): """Save the network list. This function stores the `networks' mapping to the (in-memory) configuration file. """ for netid in networks: sect = "networks/" + netid net = networks[netid] _kc.set(sect, "name", net.name) _kc.set(sect, "address", "%s/%d" % net.address) if net.username: _kc.set(sect, "username", net.username) if net.realname: _kc.set(sect, "realname", net.realname) if net.nicks: _kc.set_list(sect, "nicks", net.nicks) _kc.set_bool(sect, "autoconnect", net.autoconnect) if net.channels: _kc.set_list(sect, "channels", net.channels) _kc.save()
def apply(self): _k.networks[self.netid] = self.network self.netlistwin.refresh_netlist() _k.save_networks() _kc.save()
def apply(self): for page in self.pages: page.commit() _kc.save() _kc.update_config() _k.mainframe.reload_config()