diff -r a22552ea7d20 -r 3d4f38808370 src/ztfy/utils/protocol/xmlrpc.py --- a/src/ztfy/utils/protocol/xmlrpc.py Fri Jan 17 13:28:49 2014 +0100 +++ b/src/ztfy/utils/protocol/xmlrpc.py Wed May 07 19:03:31 2014 +0200 @@ -191,10 +191,15 @@ return xmlrpclib.Server(uri, transport=transport, verbose=verbose, allow_none=allow_none) -def getClientWithCookies(uri, credentials=(), verbose=False, allow_none=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, headers=None): +def getClientWithCookies(uri, credentials=(), verbose=False, allow_none=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, + headers=None, cookies=None): """Get an XML-RPC client which supports authentication through cookies""" + if cookies is None: + cookies = cookielib.CookieJar() if uri.startswith('https:'): - transport = SecureXMLRPCCookieAuthTransport('Python XML-RPC Client/0.1 (ZTFY secure cookie transport)', credentials, cookielib.CookieJar(), timeout, headers) + transport = SecureXMLRPCCookieAuthTransport('Python XML-RPC Client/0.1 (ZTFY secure cookie transport)', + credentials, cookies, timeout, headers) else: - transport = XMLRPCCookieAuthTransport('Python XML-RPC Client/0.1 (ZTFY basic cookie transport)', credentials, cookielib.CookieJar(), timeout, headers) + transport = XMLRPCCookieAuthTransport('Python XML-RPC Client/0.1 (ZTFY basic cookie transport)', + credentials, cookies, timeout, headers) return xmlrpclib.Server(uri, transport=transport, verbose=verbose, allow_none=allow_none)