Changeset 2513 for WAeUP_SRP


Ignore:
Timestamp:
3 Nov 2007, 12:54:41 (17 years ago)
Author:
Henrik Bettermann
Message:

improve logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_utilities/moveCourseResults.py

    r2508 r2513  
    4040#logger.info('')
    4141
    42 brains = aq_students(In('review_state',('courses_registered','courses_validated'))) 
     42brains = aq_students(In('review_state',('courses_registered','courses_validated')))
    4343total = len(brains)
    4444logger.info("found %d students" % (total))
     
    4646moved = 0
    4747cocount = 0
    48 commit_after = 5
     48commit_after = 20
    4949for brain in brains:
    50     count += 1
    51     if moved and not moved % commit_after:
    52         context.waeup_tool.doCommit()
    53         logger.info("Committing %s transactions, total %s" % (commit_after,count))
    54         cocount += 1
    55         #if cocount > 3:
    56         #    break
     50    count += 1   
    5751    already_moved = aq_results(Eq('student_id',brain.id))
    5852    if len(already_moved) > 0:
     
    6761        continue
    6862    if not results:
    69         pass
     63        continue
    7064        #rwrite('no result objects in %s/study_course/%s' % (brain.id,brain.level))
    7165    else:
    72         logger.info("moving  results of student %s" % (brain.id))
     66        #logger.info("moving  results of student %s" % (brain.id))
    7367        context.course_results.moveResultsHere(study_level,brain.id)
    7468        moved += 1
    7569        logger.info("moved  results of student %s" % (brain.id))
    76 msg = "finished moving  results of %d students" % (moved)
     70        if moved and not moved % commit_after:
     71            context.waeup_tool.doCommit()
     72            logger.info("Committing %s transactions, total %s" % (commit_after,count))
     73            #cocount += 1
     74            #if cocount > 3:
     75            #    break
     76
     77msg = "finished moving results of %d students" % (moved)
    7778logger.info(msg)
    7879#rwrite(msg)
Note: See TracChangeset for help on using the changeset viewer.