def remove_terlist(self): terlist_control.tabmenu_terlist(self) while 1: terlist_control.remove_button(self, 1) tmp = terlist_control.get_maclist(self) if tmp == [""]: break terlist_control.apply(self) time.sleep(40)
def edit_one_terlist(self): terlist_control.tabmenu_terlist(self) localmac = terlist_control.get_localmac() terlist_control.set_maclist(self, 0, localmac) terlist_control.apply(self) time.sleep(40) data = terlist_control.ssh_get_trusted() assert localmac.upper() in data, u"本地mac地址没有加入iptables表中,无法进行下一步" print network_control.rand_network(self) return network_control.rand_network(self)
def edit_terlist(self, maclist, count): terlist_control.tabmenu_terlist(self) if count > 1: i = 0 while i < count - 1: terlist_control.set_maclist(self, 0, maclist[i]) terlist_control.add_button(self) i += 1 terlist_control.set_maclist(self, 0, maclist[i]) terlist_control.apply(self) time.sleep(40) data = terlist_control.ssh_get_trusted() return data else: print u"没有添加数据"
def edit_errorlist(self, mac): terlist_control.tabmenu_terlist(self) terlist_control.set_maclist(self, 0, mac) terlist_control.apply(self) time.sleep(2) return terlist_control.validate(self)