def _is_valid(self, value: TypeOptionValue) -> bool: return is_port_number(value)
def _is_valid(self, value: TypeOptionValue) -> bool: return matches_regexp(value, "^[0-9]+-[0-9]+$") and all( is_port_number(part) for part in value.split("-", 1))
def port(self): port = self.environ.get(PCSD_PORT, settings.pcsd_default_port) if not is_port_number(port): self.errors.append(f"Invalid port number '{port}', use 1..65535") return port