(self, port)
return URIBuilder(
            scheme=self.scheme,
            userinfo=self.userinfo,
            host=self.host,
            port='{}'.format(port_int),
            path=self.path,
            query=self.query,
            fragment=self.fragment,
        )
Add port to the URI.

        .. code-block:: python

            >>> URIBuilder().add_port(80)
            URIBuilder(scheme=None, userinfo=None, host=None, port='80',
                    path=None, query=None, fragment=None)

            >>> URIBuilder().add_port(443)
            URIBuilder(scheme=None, userinfo=None, host=None, port='443',
                    path=None, query=None, fragment=None)
Add port to the URI.
Add port to the URI .
def add_port(self, port):
        """Add port to the URI.

        .. code-block:: python

            >>> URIBuilder().add_port(80)
            URIBuilder(scheme=None, userinfo=None, host=None, port='80',
                    path=None, query=None, fragment=None)

            >>> URIBuilder().add_port(443)
            URIBuilder(scheme=None, userinfo=None, host=None, port='443',
                    path=None, query=None, fragment=None)

        """
        port_int = int(port)
        if port_int < 0:
            raise ValueError(
                'ports are not allowed to be negative. You provided {}'.format(
                    port_int,
                )
            )
        if port_int > 65535:
            raise ValueError(
                'ports are not allowed to be larger than 65535. '
                'You provided {}'.format(
                    port_int,
                )
            )

        return URIBuilder(
            scheme=self.scheme,
            userinfo=self.userinfo,
            host=self.host,
            port='{}'.format(port_int),
            path=self.path,
            query=self.query,
            fragment=self.fragment,
        )
def add_port ( self , port ) : port_int = int ( port ) if port_int < 0 : raise ValueError ( 'ports are not allowed to be negative. You provided {}' . format ( port_int , ) ) if port_int > 65535 : raise ValueError ( 'ports are not allowed to be larger than 65535. ' 'You provided {}' . format ( port_int , ) ) return URIBuilder ( scheme = self . scheme , userinfo = self . userinfo , host = self . host , port = '{}' . format ( port_int ) , path = self . path , query = self . query , fragment = self . fragment , )