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

« back to all changes in this revision

Viewing changes to ivle/makeuser.py

  • Committer: William Grant
  • Date: 2010-02-23 08:48:09 UTC
  • mfrom: (1673 trunk)
  • mto: This revision was merged to the branch mainline in revision 1674.
  • Revision ID: grantw@unimelb.edu.au-20100223084809-du6dvsxrjhw15ytr
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
        f.write("""
73
73
[%(login)s:/]
74
74
%(login)s = rw
75
 
""" % {'login': u.login})
 
75
""" % {'login': u.login.encode('utf-8')})
76
76
 
77
77
    # Now we need to grant offering tutors and lecturers access to the latest
78
78
    # submissions in their offerings. There are much prettier ways to do this,
110
110
        f.write("""
111
111
# Submission %(id)d
112
112
[%(login)s:%(path)s]
113
 
""" % {'login': login, 'id': psid, 'path': pspath})
 
113
""" % {'login': login.encode('utf-8'), 'id': psid,
 
114
       'path': pspath.encode('utf-8')})
114
115
 
115
116
        for viewer_login in offering_viewers_cache[offeringid]:
116
117
            # We don't want to override the owner's write privilege,
117
118
            # so we don't add them to the read-only ACL.
118
119
            if login != viewer_login:
119
 
                f.write("%s = r\n" % viewer_login)
 
120
                f.write("%s = r\n" % viewer_login.encode('utf-8'))
120
121
 
121
122
    f.close()
122
123
    os.rename(temp_name, conf_name)
145
146
                             offering.semester.semester,
146
147
                             group.name])
147
148
 
148
 
        f.write("[%s:/]\n" % reponame)
 
149
        f.write("[%s:/]\n" % reponame.encode('utf-8'))
149
150
        if group.id not in group_members_cache:
150
151
            group_members_cache[group.id] = set()
151
152
        for user in group.members:
152
153
            group_members_cache[group.id].add(user.login)
153
 
            f.write("%s = rw\n" % user.login)
 
154
            f.write("%s = rw\n" % user.login.encode('utf-8'))
154
155
        f.write("\n")
155
156
 
156
157
    # Now we need to grant offering tutors and lecturers access to the latest
194
195
        f.write("""
195
196
# Submission %(id)d
196
197
[%(repo)s:%(path)s]
197
 
""" % {'repo': reponame, 'id': psid, 'path': pspath})
 
198
""" % {'repo': reponame.encode('utf-8'), 'id': psid,
 
199
       'path': pspath.encode('utf-8')})
198
200
 
199
201
        for viewer_login in offering_viewers_cache[offeringid]:
200
202
            # Skip existing group members, or they can't write to it any more.
326
328
    # So we just write root_dir.
327
329
    conf_obj = ivle.config.Config(blank=True)
328
330
    conf_obj.filename = conf_path
 
331
    conf_obj['urls'] = {}
329
332
    conf_obj['urls']['root'] = sys_config['urls']['root']
330
333
    conf_obj['urls']['public_host'] = sys_config['urls']['public_host']
331
334
    conf_obj['urls']['svn_addr'] = sys_config['urls']['svn_addr']
 
335
    conf_obj['user_info'] = {}
332
336
    conf_obj['user_info']['login'] = username
333
337
    conf_obj['user_info']['svn_pass'] = svn_pass
334
338
    conf_obj.write()