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

« back to all changes in this revision

Viewing changes to ivle/makeuser.py

  • Committer: Matt Giuca
  • Date: 2010-02-18 05:33:30 UTC
  • Revision ID: matt.giuca@gmail.com-20100218053330-c3kuixsazmxtg49i
Correct locale setting for Subversion. Previously pysvn would throw a nasty
error on non-ASCII UTF-8 filenames, because its locale was not set to UTF-8.
Now locale.setlocale is called on all Python scripts which use pysvn
(ivle-fetchsubmissions, ivle.fileservice_lib, diffservice, svnlogservice).

bin/ivle-buildjail: Now runs locale-gen as root inside the jail when run with
-u. This is necessary to make en_US.UTF-8 a valid locale; otherwise ALL JAIL
CODE will now crash!

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
                    User.login,
103
103
                    User.id == Enrolment.user_id,
104
104
                    Enrolment.offering_id == offeringid,
105
 
                    Enrolment.role.is_in((u'tutor', u'lecturer'))
 
105
                    Enrolment.role.is_in((u'tutor', u'lecturer')),
 
106
                    Enrolment.active == True,
106
107
                )
107
108
            )
108
109
 
185
186
                    User.login,
186
187
                    User.id == Enrolment.user_id,
187
188
                    Enrolment.offering_id == offeringid,
188
 
                    Enrolment.role.is_in((u'tutor', u'lecturer'))
 
189
                    Enrolment.role.is_in((u'tutor', u'lecturer')),
 
190
                    Enrolment.active == True,
189
191
                )
190
192
            )
191
193
 
269
271
        # User jail already exists. Blow it away but preserve their home
270
272
        # directory. It should be all that is there anyway, but you never
271
273
        # know!
272
 
        # Ignore warnings about the use of tmpnam
 
274
        # Ignore warnings about the use of tempnam
273
275
        warnings.simplefilter('ignore')
274
276
        homebackup = os.tempnam(tempdir)
275
277
        warnings.resetwarnings()
324
326
    # So we just write root_dir.
325
327
    conf_obj = ivle.config.Config(blank=True)
326
328
    conf_obj.filename = conf_path
 
329
    conf_obj['urls'] = {}
327
330
    conf_obj['urls']['root'] = sys_config['urls']['root']
328
331
    conf_obj['urls']['public_host'] = sys_config['urls']['public_host']
329
332
    conf_obj['urls']['svn_addr'] = sys_config['urls']['svn_addr']
 
333
    conf_obj['user_info'] = {}
330
334
    conf_obj['user_info']['login'] = username
331
335
    conf_obj['user_info']['svn_pass'] = svn_pass
332
336
    conf_obj.write()