~ubuntu-branches/ubuntu/saucy/mumble-django/saucy-proposed

« back to all changes in this revision

Viewing changes to pyweb/djextdirect/client.py

  • Committer: Package Import Robot
  • Author(s): Michael Ziegler
  • Date: 2013-05-19 18:06:11 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20130519180611-flqpsk20fu2t6hq4
Tags: 2.9-1
* New upstream release.
* Drop DM-Upload-Allowed as it isn't used any longer.
* Update VCS-{SVN,Browser} tags.
* Update Django dependency to 1.5.
* Remove template patch for django-registration 0.8 (applied upstream).
* Remove the hunk that adds MessageMiddleware to settings.py (applied
  upstream).
* Disable the registration app for now (incompatible to Django 1.5).
* Remove dependency to python-simplejson.
* Adapt apache config to staticfiles change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *  GNU General Public License for more details.
16
16
"""
17
17
 
18
 
try:
19
 
    import simplejson
20
 
except ImportError:
21
 
    import json as simplejson
22
 
 
 
18
import json
23
19
import httplib
24
20
from threading import Lock
25
21
from urlparse import urljoin, urlparse
49
45
        elif state == ST_ASSIGN:
50
46
            if   char == ';':
51
47
                state = ST_NAME
52
 
                foundvars[name] = simplejson.loads(buf)
 
48
                foundvars[name] = json.loads(buf)
53
49
                name = ""
54
50
                buf  = ""
55
51
            else:
135
131
    def call( self, action, method, *args ):
136
132
        """ Make a call to Ext.Direct. """
137
133
        reqtid = self.tid
138
 
        data=simplejson.dumps({
 
134
        data=json.dumps({
139
135
            'tid':    reqtid,
140
136
            'action': action,
141
137
            'method': method,
160
156
        if resp.status != 200:
161
157
            raise RequestError( resp.status, resp.reason )
162
158
 
163
 
        respdata = simplejson.loads( resp.read() )
 
159
        respdata = json.loads( resp.read() )
164
160
        if respdata['type'] == 'exception':
165
161
            raise ReturnedError( respdata['message'], respdata['where'] )
166
162
        if respdata['tid'] != reqtid: