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

« back to all changes in this revision

Viewing changes to services/svnlogservice

  • Committer: Matt Giuca
  • Date: 2010-03-05 07:20:43 UTC
  • Revision ID: matt.giuca@gmail.com-20100305072043-kbm4ysw08h610wod
Lecturer project page: Added link to External Subversion access to help lecturers figure out how to get their SVN password.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import sys
29
29
import locale
30
30
 
31
 
try:
32
 
    import json
33
 
except ImportError:
34
 
    import simplejson as json
35
 
 
 
31
import cjson
36
32
import pysvn
37
33
 
38
34
import ivle.conf
47
43
    client.exception_style = 1
48
44
    logs = client.log(os.path.join('/home', sys.argv[1].decode('utf-8')),
49
45
                      discover_changed_paths=True)
50
 
    print json.dumps({'logs': [{'revno': log.revision.number,
51
 
                                'author': log.author.decode('utf-8'),
52
 
                                'message': log.message.decode('utf-8'),
53
 
                                'date': log.date,
54
 
                                'paths': [(p.path.decode('utf-8'), p.action)
55
 
                                          for p in log.changed_paths]}
56
 
                               for log in logs]})
 
46
    print cjson.encode({'logs': [{'revno': log.revision.number,
 
47
                                  'author': log.author.decode('utf-8'),
 
48
                                  'message': log.message.decode('utf-8'),
 
49
                                  'date': log.date,
 
50
                                  'paths': [(p.path.decode('utf-8'), p.action)
 
51
                                            for p in log.changed_paths]}
 
52
                                 for log in logs]})
57
53
except pysvn.ClientError, e:
58
54
    error = e[0]
59
55
 
72
68
    except IndexError:
73
69
        pass
74
70
 
75
 
    print json.dumps({'error': error})
 
71
    print cjson.encode({'error': error})