(self, username, password)
return URIBuilder(
            scheme=self.scheme,
            userinfo=userinfo,
            host=self.host,
            port=self.port,
            path=self.path,
            query=self.query,
            fragment=self.fragment,
        )
Add credentials as the userinfo portion of the URI.

        .. code-block:: python

            >>> URIBuilder().add_credentials('root', 's3crete')
            URIBuilder(scheme=None, userinfo='root:s3crete', host=None,
                    port=None, path=None, query=None, fragment=None)

            >>> URIBuilder().add_credentials('root', None)
            URIBuilder(scheme=None, userinfo='root', host=None,
                    port=None, path=None, query=None, fragment=None)
Add credentials as the userinfo portion of the URI.
Add credentials as the userinfo portion of the URI .
def add_credentials(self, username, password):
        """Add credentials as the userinfo portion of the URI.

        .. code-block:: python

            >>> URIBuilder().add_credentials('root', 's3crete')
            URIBuilder(scheme=None, userinfo='root:s3crete', host=None,
                    port=None, path=None, query=None, fragment=None)

            >>> URIBuilder().add_credentials('root', None)
            URIBuilder(scheme=None, userinfo='root', host=None,
                    port=None, path=None, query=None, fragment=None)
        """
        if username is None:
            raise ValueError('Username cannot be None')
        userinfo = normalizers.normalize_username(username)

        if password is not None:
            userinfo = '{}:{}'.format(
                userinfo,
                normalizers.normalize_password(password),
            )

        return URIBuilder(
            scheme=self.scheme,
            userinfo=userinfo,
            host=self.host,
            port=self.port,
            path=self.path,
            query=self.query,
            fragment=self.fragment,
        )
def add_credentials ( self , username , password ) : if username is None : raise ValueError ( 'Username cannot be None' ) userinfo = normalizers . normalize_username ( username ) if password is not None : userinfo = '{}:{}' . format ( userinfo , normalizers . normalize_password ( password ) , ) return URIBuilder ( scheme = self . scheme , userinfo = userinfo , host = self . host , port = self . port , path = self . path , query = self . query , fragment = self . fragment , )