def switchHost(self, event): hosts_id = event.GetId() title = self.hosts[hosts_id] oh = self.frame.getOHostsFromTitle(title) if oh: co.switchHost(self, oh.path) self.frame.updateListCtrl()
def switchHost(self, event): hosts_id = event.GetId() title = self.hosts[hosts_id] oh = self.frame.getOHostsFromTitle(title) if oh: co.switchHost(self, oh.path, oh.getContent( replace_import=True, with_config=True )) self.frame.updateListCtrl()
def applyHost(self, event=None, ohosts=None): u"""应用某个 hosts""" # 保存当前 hosts 的内容 self.saveCurrentHost() # 切换 hosts co.switchHost(self.taskbar_icon, self.current_selected_hosts_fn) self.updateListCtrl() self.m_btn_apply.Disable()
def applyHost(self, event=None, ohosts=None): u"""应用某个 hosts""" ohosts = self.getOHostsFromFn() # 当前 hosts # 保存当前 hosts 的内容 self.saveCurrentHost(ohosts) # 切换 hosts ohosts.frame = self co.switchHost(self.taskbar_icon, self.current_selected_hosts_fn, ohosts.getContent( replace_import=True, with_config=True, frame=self, )) self.updateListCtrl() self.m_btn_apply.Disable()