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

« back to all changes in this revision

Viewing changes to makeuser.py

  • Committer: mattgiuca
  • Date: 2008-02-03 11:38:23 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:387
Implemented file uploads.
fileservice: Added "putfiles" action (slightly different to putfile action;
    see comments at top which discuss the difference).
browser/listing: Added "upload" button to side panel, which opens an upload
    panel with a file selection dialog. This uses a little trick (documented
    in the code) to get the upload to work without refreshing the page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
import conf
33
33
import common.makeuser
34
34
 
35
 
if len(sys.argv) <= 1:
36
 
    print "Usage: python makeuser.py <username>"
 
35
if len(sys.argv) <= 6:
 
36
    print "Usage: python makeuser.py <username> <password> <nick> " \
 
37
        "<fullname> <rolenm> <studentid>"
37
38
    sys.exit()
38
39
 
39
40
username = sys.argv[1]
 
41
password = sys.argv[2]
 
42
nick = sys.argv[3]
 
43
fullname = sys.argv[4]
 
44
rolenm = sys.argv[5]
 
45
studentid = sys.argv[6]
40
46
 
41
47
try:
42
 
    common.makeuser.makeuser(username)
 
48
    common.makeuser.makeuser(username, password, nick, fullname, rolenm,
 
49
        studentid)
43
50
except Exception, message:
44
51
    print "Error: " + str(message)
45
52
    sys.exit(1)
46
53
 
47
 
print "Successfully created user " + username + "."
 
54
print "Successfully created user %s (%s)." % (username, fullname)