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

« back to all changes in this revision

Viewing changes to bin/ivle-enrolallusers

  • Committer: Matt Giuca
  • Date: 2009-05-13 03:18:42 UTC
  • mto: This revision was merged to the branch mainline in revision 1247.
  • Revision ID: matt.giuca@gmail.com-20090513031842-v24d9dvmog6adp2c
ivle-fetchsubmissions: Added -v option to print out submissions to stdout.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    print >> sys.stderr, "%s must be run as root" % sys.argv[0]
56
56
    sys.exit(1)
57
57
 
58
 
config = ivle.config.Config()
59
 
store = ivle.database.get_store(config)
60
 
 
 
58
store = ivle.database.get_store(ivle.config.Config())
61
59
if options.user is None:
62
60
    users = store.find(ivle.database.User).order_by(ivle.database.User.login)
63
61
else:
78
76
    try:
79
77
        # Get all subjects this user is enrolled in, and add them to the DB if
80
78
        # they match one of our local subject codes
81
 
        res = ivle.pulldown_subj.enrol_user(config, store, user, options.year)
 
79
        res = ivle.pulldown_subj.enrol_user(store, user, options.year)
82
80
        logging.info("Enrolled user %s in %d subject%s." % (user.login, res,
83
81
                        '' if res == 1 else 's'))
84
82
    except Exception, message: