Ejemplo n.º 1
0
    def __init__(self, handle_server_url, username, password, prefix=None, handleowner=None, **config):
        '''
        Initialize client credentials instance with Handle server url,
            username and password.

        :param handle_server_url: URL to your handle server
        :param username: User information in the format "index:prefix/suffix"
        :param password: Password.
        :param prefix: Prefix.
        :param config: Any key-value pairs added are stored as config.
        :raises: HandleSyntaxError
        '''
        EUDATHandleClient.check_handle_syntax_with_index(username)
        self.__handle_server_url = handle_server_url
        self.__username = username
        self.__password = password
        self.__prefix = prefix
        self.__handleowner = handleowner
        self.__config = None
        if len(config) > 0:
            self.__config = config

        if handleowner is not None:
            EUDATHandleClient.check_handle_syntax_with_index(handleowner)
            self.__handleowner = handleowner