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

« back to all changes in this revision

Viewing changes to services/diffservice

  • Committer: William Grant
  • Date: 2010-07-20 04:52:31 UTC
  • mto: This revision was merged to the branch mainline in revision 1826.
  • Revision ID: grantw@unimelb.edu.au-20100720045231-8ia3uk8nao8zdq1i
Replace cjson with json, or simplejson if json is not available (Python <2.6)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import sys
29
29
import locale
30
30
 
31
 
import cjson
 
31
try:
 
32
    import json
 
33
except ImportError:
 
34
    import simplejson as json
32
35
import pysvn
33
36
 
34
37
import ivle.conf
66
69
        revision1=revs[0],
67
70
        revision2=revs[1]
68
71
    )
69
 
    print cjson.encode({'diff': diff_text.decode('utf-8')})
 
72
    print json.dumps({'diff': diff_text.decode('utf-8')})
70
73
except pysvn.ClientError, e:
71
74
    error = e[0]
72
75
 
84
87
    except IndexError:
85
88
        pass
86
89
 
87
 
    print cjson.encode({'error': error})
 
90
    print json.dumps({'error': error})