Changeset 1485


Ignore:
Timestamp:
24 Feb 2007, 18:24:57 (18 years ago)
Author:
joachim
Message:

new logging messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelForNewStudents.py

    r1484 r1485  
    1212list Students for ClearanceOfficers
    1313"""
     14try:
     15    from Products.zdb import set_trace
     16except:
     17    def set_trace():
     18        pass
    1419
    1520request = context.REQUEST
     
    1722response = request.RESPONSE
    1823setheader = request.RESPONSE.setHeader
     24import logging
     25logger = logging.getLogger('fixLevelForNewStudents')
    1926
    2027def rwrite(s):
     
    4148query = Eq('level','100')
    4249res = aq_students(query)
     50set_trace()
    4351count = 0
     52logger.info("started for %s students" % len(res))
    4453for sbrain in res:
    4554    student_obj = getattr(students,sbrain.id)
     
    6372        continue
    6473    student_obj.study_course.getContent().edit(mapping={'current_level': level,
    65                                                                        'current_verdict': 'N/A'})
     74                                                        'current_verdict': 'N/A'})
    6675    count += 1
     76    if count > 10:
     77        break
    6778    rwrite("%s: %s %s %s <br />" % (count,sbrain.id,entry_mode,level))
    68 
     79rwrite("finished")
     80logger.info("finished  %s students" % count)
Note: See TracChangeset for help on using the changeset viewer.