def scan(self, task): """Wrapper method around _frequency and _bookmarks. It calls one of the wrapped functions matching the task.mode value :param task: object that represent a scanning task :type task: object from ScanningTask :raises: none :returns: updates the scanning task object with the new activity found """ rigctl = RigCtl() if task and task.mode.lower() == "bookmarks": updated_task = self._bookmarks(task, rigctl) elif task and task.mode.lower() == "frequency": updated_task = self._frequency(task, rigctl) return updated_task
def apply_config(self, ac): """Applies the config to the UI. :param ac: object instance for handling the app config :type ac: AppConfig object :raises : none :returns : none """ ac.read_conf() self.txt_hostname.insert(0, ac.config["hostname"]) self.txt_port.insert(0, ac.config["port"]) self.txt_interval.insert(0, ac.config["interval"]) self.txt_delay.insert(0, ac.config["delay"]) self.txt_sgn_level.insert(0, ac.config["sgn_level"]) self.txt_range_min.insert(0, ac.config["range_min"]) self.txt_range_max.insert(0, ac.config["range_max"]) self.cb_save_exit.set(ac.config["save_exit"].lower()) self.cb_auto_bookmark.set(ac.config["auto_bookmark"].lower()) if ac.config["always_on_top"].lower() == "true": if self.ckb_top.state() != ("selected"): self.ckb_top.invoke() self.rigctl = RigCtl(self.txt_hostname.get(), self.txt_port.get())
def test_get_connection_refused(hostname, port): DEFAULT_CONFIG["hostname"] = hostname DEFAULT_CONFIG["port"] = port rigctl = RigCtl() with pytest.raises(socket.error): rigctl.get_frequency()