def _snd_msg(self, button, fn=None): if not fn: try: sel = self._messages.get_selected_messages() except TypeError: return if len(sel) > 1: print("FIXME: Warn about multiple send") return fn = sel[0] recip = self._messages.current_info.get_msg_recip(fn) if not msgrouting.msg_lock(fn): display_error(_("Unable to send: message in use by another task")) return stations = [] ports = self.emit("get-station-list") for slist in list(ports.values()): stations += slist if recip in stations: stations.remove(recip) stations.insert(0, recip) station, port = prompt_for_station(stations, self._config) if not station: msgrouting.msg_unlock(fn) return self.emit("user-send-form", station, port, fn, "foo")
def do_ping(but): station_list = self.emit("get-station-list") stations = [] for portlist in station_list.values(): stations += [str(x) for x in portlist] station, port = prompt_for_station(stations, self._config) if station: self.emit("ping-station", station, port)