def __init__(self, url, user, password, cookieAuth=False, **kwargs):
<EOL>try:<EOL><INDENT>params = _URL_RE.search(url).groupdict()<EOL>if cookieAuth == False:<EOL><INDENT>url = '<STR_LIT>' % (<EOL>params['<STR_LIT>'], user, password, params['<STR_LIT:host>'], params['<STR_LIT>'] or '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>url = '<STR_LIT>' % (<EOL>params['<STR_LIT>'], params['<STR_LIT:host>'], params['<STR_LIT>'] or '<STR_LIT>')<EOL><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>raise DokuWikiError("<STR_LIT>" %  url)<EOL><DEDENT>if cookieAuth == False:<EOL><INDENT>self.proxy = ServerProxy(url, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>if sys.version_info[<NUM_LIT:0>] == <NUM_LIT:3>:<EOL><INDENT>self.proxy = ServerProxy(url, CookiesTransport(), **kwargs)<EOL><DEDENT>else:<EOL><INDENT>self.proxy = ServerProxy(url, CookiesTransport2(), **kwargs)<EOL><DEDENT><DEDENT>if not self.login(user, password):<EOL><INDENT>raise DokuWikiError('<STR_LIT>')<EOL><DEDENT>self.pages = _Pages(weakref.ref(self)())<EOL>self.medias = _Medias(weakref.ref(self)())<EOL>
Initialize the object by connecting to the XMLRPC server.