(self, port)
return False
Query whether this Router will accept the given port.
Query whether this Router will accept the given port.
Query whether this Router will accept the given port .
def accepts_port(self, port):
        """
        Query whether this Router will accept the given port.
        """

        if self.rejected_ports is None and self.accepted_ports is None:
            raise RuntimeError("policy hasn't been set yet")

        if self.rejected_ports:
            for x in self.rejected_ports:
                if port == x:
                    return False
            return True

        for x in self.accepted_ports:
            if port == x:
                return True
        return False
def accepts_port ( self , port ) : if self . rejected_ports is None and self . accepted_ports is None : raise RuntimeError ( "policy hasn't been set yet" ) if self . rejected_ports : for x in self . rejected_ports : if port == x : return False return True for x in self . accepted_ports : if port == x : return True return False