aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/lib
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/lib
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/lib')
-rw-r--r--linden/indra/lib/python/indra/base/llsd.py12
-rw-r--r--linden/indra/lib/python/indra/ipc/llsdhttp.py31
-rw-r--r--linden/indra/lib/python/indra/util/llmanifest.py2
3 files changed, 21 insertions, 24 deletions
diff --git a/linden/indra/lib/python/indra/base/llsd.py b/linden/indra/lib/python/indra/base/llsd.py
index 71282bc..26ac3a2 100644
--- a/linden/indra/lib/python/indra/base/llsd.py
+++ b/linden/indra/lib/python/indra/base/llsd.py
@@ -842,16 +842,6 @@ try:
842except: 842except:
843 print "Couldn't import mulib.stacked, not registering LLSD converters" 843 print "Couldn't import mulib.stacked, not registering LLSD converters"
844else: 844else:
845 def llsd_convert_json(llsd_stuff, request):
846 callback = request.get_header('callback')
847 if callback is not None:
848 ## See Yahoo's ajax documentation for information about using this
849 ## callback style of programming
850 ## http://developer.yahoo.com/common/json.html#callbackparam
851 req.write("%s(%s)" % (callback, simplejson.dumps(llsd_stuff)))
852 else:
853 req.write(simplejson.dumps(llsd_stuff))
854
855 def llsd_convert_xml(llsd_stuff, request): 845 def llsd_convert_xml(llsd_stuff, request):
856 request.write(format_xml(llsd_stuff)) 846 request.write(format_xml(llsd_stuff))
857 847
@@ -859,8 +849,6 @@ else:
859 request.write(format_binary(llsd_stuff)) 849 request.write(format_binary(llsd_stuff))
860 850
861 for typ in [LLSD, dict, list, tuple, str, int, float, bool, unicode, type(None)]: 851 for typ in [LLSD, dict, list, tuple, str, int, float, bool, unicode, type(None)]:
862 stacked.add_producer(typ, llsd_convert_json, 'application/json')
863
864 stacked.add_producer(typ, llsd_convert_xml, 'application/llsd+xml') 852 stacked.add_producer(typ, llsd_convert_xml, 'application/llsd+xml')
865 stacked.add_producer(typ, llsd_convert_xml, 'application/xml') 853 stacked.add_producer(typ, llsd_convert_xml, 'application/xml')
866 stacked.add_producer(typ, llsd_convert_xml, 'text/xml') 854 stacked.add_producer(typ, llsd_convert_xml, 'text/xml')
diff --git a/linden/indra/lib/python/indra/ipc/llsdhttp.py b/linden/indra/lib/python/indra/ipc/llsdhttp.py
index 1bb335e..378c1c2 100644
--- a/linden/indra/lib/python/indra/ipc/llsdhttp.py
+++ b/linden/indra/lib/python/indra/ipc/llsdhttp.py
@@ -34,45 +34,54 @@ from indra.base import llsd
34 34
35from eventlet import httpc 35from eventlet import httpc
36 36
37 37suite = httpc.HttpSuite(llsd.format_xml, llsd.parse, 'application/xml+llsd')
38get, put, delete, post = httpc.make_suite( 38delete = suite.delete
39 llsd.format_xml, llsd.parse, 'application/xml+llsd') 39delete_ = suite.delete_
40 40get = suite.get
41get_ = suite.get_
42head = suite.head
43head_ = suite.head_
44post = suite.post
45post_ = suite.post_
46put = suite.put
47put_ = suite.put_
48request = suite.request
49request_ = suite.request_
41 50
42for x in (httpc.ConnectionError, httpc.NotFound, httpc.Forbidden): 51for x in (httpc.ConnectionError, httpc.NotFound, httpc.Forbidden):
43 globals()[x.__name__] = x 52 globals()[x.__name__] = x
44 53
45 54
46def postFile(url, filename, verbose=False): 55def postFile(url, filename):
47 f = open(filename) 56 f = open(filename)
48 body = f.read() 57 body = f.read()
49 f.close() 58 f.close()
50 llsd_body = llsd.parse(body) 59 llsd_body = llsd.parse(body)
51 return post(url, llsd_body, verbose=verbose) 60 return post_(url, llsd_body)
52 61
53 62
54def getStatus(url, use_proxy=False): 63def getStatus(url, use_proxy=False):
55 status, _headers, _body = get(url, use_proxy=use_proxy, verbose=True) 64 status, _headers, _body = get_(url, use_proxy=use_proxy)
56 return status 65 return status
57 66
58 67
59def putStatus(url, data): 68def putStatus(url, data):
60 status, _headers, _body = put(url, data, verbose=True) 69 status, _headers, _body = put_(url, data)
61 return status 70 return status
62 71
63 72
64def deleteStatus(url): 73def deleteStatus(url):
65 status, _headers, _body = delete(url, verbose=True) 74 status, _headers, _body = delete_(url)
66 return status 75 return status
67 76
68 77
69def postStatus(url, data): 78def postStatus(url, data):
70 status, _headers, _body = post(url, data, verbose=True) 79 status, _headers, _body = post_(url, data)
71 return status 80 return status
72 81
73 82
74def postFileStatus(url, filename): 83def postFileStatus(url, filename):
75 status, _headers, body = postFile(url, filename, verbose=True) 84 status, _headers, body = postFile(url, filename)
76 return status, body 85 return status, body
77 86
78 87
diff --git a/linden/indra/lib/python/indra/util/llmanifest.py b/linden/indra/lib/python/indra/util/llmanifest.py
index 1bd44ae..89c14e8 100644
--- a/linden/indra/lib/python/indra/util/llmanifest.py
+++ b/linden/indra/lib/python/indra/util/llmanifest.py
@@ -94,7 +94,7 @@ def get_channel(srctree):
94 for p in paths: 94 for p in paths:
95 if os.path.exists(p): 95 if os.path.exists(p):
96 contents = open(p, 'r').read() 96 contents = open(p, 'r').read()
97 channel = re.search("LL_CHANNEL\s=\s\"([\w\s]+)\"", contents).group(1) 97 channel = re.search("LL_CHANNEL\s=\s\"(.+)\";\s*$", contents, flags = re.M).group(1)
98 return channel 98 return channel
99 99
100 100