~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/serve/__init__.py

  • Committer: William Grant
  • Date: 2010-07-28 04:13:05 UTC
  • mfrom: (1801.1.2 die-cjson-die)
  • Revision ID: grantw@unimelb.edu.au-20100728041305-xwypm3cn1l1mnki1
Port from cjson to (simple)json.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
import os
28
28
 
29
 
import cjson
 
29
try:
 
30
    import json
 
31
except ImportError:
 
32
    import simplejson as json
30
33
 
31
34
from ivle import (studpath, interpret)
32
35
from ivle.database import User
112
115
        assert not err
113
116
 
114
117
        # Remove the JSON from the front of the response, and decode it.
115
 
        json = out.split('\n', 1)[0]
116
 
        out = out[len(json) + 1:]
117
 
        response = cjson.decode(json)
 
118
        j = out.split('\n', 1)[0]
 
119
        out = out[len(j) + 1:]
 
120
        response = json.loads(j)
118
121
 
119
122
        if 'error' in response:
120
123
            if response['error'] == 'not-found':