def select_start_chno(self): start_chno = gui.numeric(_.ENTER_START_CHNO, default=self.start_chno) if start_chno is None: return False self.start_chno = start_chno return True
def edit_chno(self, channel): self.fields['chno'] = self.fields.get('chno', channel.chno) new_chno = gui.numeric( 'Channel Number', default=self.fields['chno'] if self.fields['chno'] != None else '') try: new_chno = int(new_chno) except: new_chno = None if new_chno == channel.chno: self.fields.pop('chno') elif new_chno: self.fields['chno'] = new_chno else: return False return True