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

« back to all changes in this revision

Viewing changes to bin/ivle-remakeuser

  • Committer: Matt Giuca
  • Date: 2009-01-19 17:28:59 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: matt.giuca@gmail.com-20090119172859-htjq3rfpp0fhtpc9
ivle.worksheet: Added calculate_score. This is a nice clean Storm port of
    ivle.db.calculate_worksheet_score.
tutorial: Replaced use of ivle.db.calculate_worksheet_score with
    ivle.worksheet.calculate_score.
    Guess What!! Removed this module's dependency on ivle.db! Hooray!
    (Note: tutorialservice still depends on it).
bin/ivle-marks: Updated this script to use ivle.worksheet_calculate_score.
    Note that this DOES NOT execute properly -- it seems it didn't even
    before my changes (tries to call db.get_users). Not my fault; I'm
    committing and going to bed!
ivle.db: Removed calculate_worksheet_score.
    As this removes the dependency on get_problem_status, removed that too!
    Almost all the worksheet stuff is gone now!

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import os
29
29
import optparse
30
30
import logging
31
 
import traceback
32
31
 
33
 
import ivle.config
34
32
import ivle.database
35
33
import ivle.makeuser
36
34
 
50
48
                          os.path.basename(sys.argv[0])
51
49
    sys.exit(1)
52
50
 
53
 
config = ivle.config.Config()
54
 
store = ivle.database.get_store(config)
 
51
store = ivle.database.get_store()
55
52
 
56
53
if options.all:
57
54
    users = store.find(ivle.database.User).order_by(ivle.database.User.login)
65
62
 
66
63
for user in users:
67
64
    try:
68
 
        ivle.makeuser.make_jail(user, config)
 
65
        ivle.makeuser.make_jail(user)
69
66
    except Exception, message:
70
 
        logging.error("Failed to recreate jail for %s.\n%s" % 
71
 
                      (user.login, traceback.format_exc()))
 
67
        logging.warning(str(message))
72
68
        continue
73
69
 
74
70
    logging.debug("recreated user %s's jail." % user.login)