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

« back to all changes in this revision

Viewing changes to bin/ivle-makeuser

  • Committer: chadnickbok
  • Date: 2009-01-19 22:56:46 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1170
This commit fixes issue #10 and part of issue #9

There are now two options for moving files with their
svn history intact; svn move and svn copy. These
use the svn commands to move the files, allowing students
to move and rename files without their histories being
lost.

This commit also shows the svn status of a dir, if it is
the 'head' of an svn repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
import os
32
32
import getopt
33
33
 
34
 
from ivle.database import get_store, User
35
 
from ivle.pulldown_subj import enrol_user
 
34
import ivle.makeuser
36
35
 
37
36
# Requireds and optionals will be used to display the usage message
38
37
# AND do argument processing
67
66
# Get the dictionary of fields from opts and args
68
67
user = {}
69
68
for i in range(0, len(requireds)):
70
 
    user[requireds[i]] = unicode(args[i])
 
69
    user[requireds[i]] = args[i]
71
70
for short, long, _ in optionals:
72
71
    try:
73
 
        user[long] = unicode(opts['-' + short])
 
72
        user[long] = opts['-' + short]
74
73
    except KeyError:
75
74
        try:
76
 
            user[long] = unicode(opts['--' + long])
 
75
            user[long] = opts['--' + long]
77
76
        except KeyError:
78
77
            pass
79
78
login = user['login']
80
79
if 'nick' not in user:
81
80
    user['nick'] = user['fullname']
82
81
 
83
 
store = get_store()
84
 
 
85
82
try:
86
83
    # Make the user's database entry
87
 
    userobj = User(**user)
88
 
    store.add(userobj)
89
 
    enrol_user(store, userobj)
90
 
    store.commit()
 
84
    ivle.makeuser.make_user_db(**user)
91
85
except Exception, message:
92
86
    print "Error: " + str(message)
93
87
    sys.exit(1)