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

« back to all changes in this revision

Viewing changes to services/svnlogservice

  • Committer: William Grant
  • Date: 2010-02-26 08:06:58 UTC
  • Revision ID: grantw@unimelb.edu.au-20100226080658-a57yf98u8smthfym
Update role docs with per-exercise worksheet completion stats, and note that lecturers hold the policy-specific tutor permissions regardless of the policy setting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
import os
28
28
import sys
 
29
import locale
29
30
 
30
31
import cjson
31
32
import pysvn
32
33
 
 
34
import ivle.conf
33
35
import ivle.svn
34
36
 
 
37
# Set locale to UTF-8
 
38
locale.setlocale(locale.LC_CTYPE, "en_US.UTF-8")
 
39
 
35
40
try:
36
 
    client = pysvn.Client()
 
41
    client = ivle.svn.create_auth_svn_client(username=ivle.conf.login,
 
42
                                             password=ivle.conf.svn_pass)
37
43
    client.exception_style = 1
38
 
    logs = client.log(os.path.join('/home', sys.argv[1]),
 
44
    logs = client.log(os.path.join('/home', sys.argv[1].decode('utf-8')),
39
45
                      discover_changed_paths=True)
40
46
    print cjson.encode({'logs': [{'revno': log.revision.number,
41
 
                                  'author': log.author,
42
 
                                  'message': log.message,
 
47
                                  'author': log.author.decode('utf-8'),
 
48
                                  'message': log.message.decode('utf-8'),
43
49
                                  'date': log.date,
44
 
                                  'paths': [(p.path, p.action)
 
50
                                  'paths': [(p.path.decode('utf-8'), p.action)
45
51
                                            for p in log.changed_paths]}
46
52
                                 for log in logs]})
47
53
except pysvn.ClientError, e: