Exemple #1
0
 def _is_valid(self, value: TypeOptionValue) -> bool:
     return is_port_number(value)
Exemple #2
0
 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))
Exemple #3
0
 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