~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-15 05:37:50 UTC
  • Revision ID: grantw@unimelb.edu.au-20100215053750-hihmegnp8e7dshc2
Ignore test coverage files.

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