From c0c5bdbbb90e0bcdab558ec22ea352c9d08dc078 Mon Sep 17 00:00:00 2001 From: Josh Bell Date: Fri, 14 Mar 2008 19:54:41 +0000 Subject: svn merge -r 82064:82066 svn+ssh://svn/svn/linden/qa/dev-11639-sandbox Merge fix for DEV-11639 - fix for llsdhttp.py to work with newer eventlet API --- indra/lib/python/indra/ipc/llsdhttp.py | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'indra/lib/python') diff --git a/indra/lib/python/indra/ipc/llsdhttp.py b/indra/lib/python/indra/ipc/llsdhttp.py index 0d1a1c63d6..eb9247da93 100644 --- a/indra/lib/python/indra/ipc/llsdhttp.py +++ b/indra/lib/python/indra/ipc/llsdhttp.py @@ -34,45 +34,54 @@ from indra.base import llsd from eventlet import httpc - -get, put, delete, post = httpc.make_suite( - llsd.format_xml, llsd.parse, 'application/xml+llsd') - +suite = httpc.HttpSuite(llsd.format_xml, llsd.parse, 'application/xml+llsd') +delete = suite.delete +delete_ = suite.delete_ +get = suite.get +get_ = suite.get_ +head = suite.head +head_ = suite.head_ +post = suite.post +post_ = suite.post_ +put = suite.put +put_ = suite.put_ +request = suite.request +request_ = suite.request_ for x in (httpc.ConnectionError, httpc.NotFound, httpc.Forbidden): globals()[x.__name__] = x -def postFile(url, filename, verbose=False): +def postFile(url, filename): f = open(filename) body = f.read() f.close() llsd_body = llsd.parse(body) - return post(url, llsd_body, verbose=verbose) + return post_(url, llsd_body) def getStatus(url, use_proxy=False): - status, _headers, _body = get(url, use_proxy=use_proxy, verbose=True) + status, _headers, _body = get_(url, use_proxy=use_proxy) return status def putStatus(url, data): - status, _headers, _body = put(url, data, verbose=True) + status, _headers, _body = put_(url, data) return status def deleteStatus(url): - status, _headers, _body = delete(url, verbose=True) + status, _headers, _body = delete_(url) return status def postStatus(url, data): - status, _headers, _body = post(url, data, verbose=True) + status, _headers, _body = post_(url, data) return status def postFileStatus(url, filename): - status, _headers, body = postFile(url, filename, verbose=True) + status, _headers, body = postFile(url, filename) return status, body -- cgit v1.2.3