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

« back to all changes in this revision

Viewing changes to makeuser.py

  • Committer: dcoles
  • Date: 2008-03-10 06:11:51 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:682
Natural Language Tool Kit (nltk) for student code

setup.py: copy '/usr/share/nltk' into jail
d/s/install_proc.txt: How to download and install NLTK
d/dependencies.txt: Added NLTK as a student code dependancy

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
import sys
31
31
import os
32
32
import os.path
 
33
import pwd
33
34
import getopt
34
35
import random
35
36
# Import modules from the website is tricky since they're in the www
44
45
requireds = ["login", "fullname", "rolenm"]
45
46
optionals = [
46
47
    ('p', 'password', "Cleartext password for this user"),
 
48
    ('u', 'unixid', "Numeric unix user id"),
47
49
    ('n', 'nick', "Display name (defaults to <fullname>)"),
48
50
    ('e', 'email', "Email address"),
49
51
    ('s', 'studentid', "Student ID")
83
85
if 'nick' not in user:
84
86
    user['nick'] = user['fullname']
85
87
 
 
88
# Resolve the user's username into a UID
 
89
if 'unixid' not in user:
 
90
    try:
 
91
        (_,_,uid,_,_,_,_) = pwd.getpwnam(login)
 
92
        user['unixid'] = uid
 
93
    except KeyError:
 
94
        user['unixid'] = random.randrange(5000,10000)
 
95
 
86
96
try:
87
97
    # Make the user's database entry
88
98
    common.makeuser.make_user_db(**user)