Changeset 1567 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
17 Mar 2007, 08:34:51 (18 years ago)
Author:
Henrik Bettermann
Message:

new logging format Part 2

Location:
WAeUP_SRP/trunk/skins/waeup_utilities
Files:
1 added
6 edited

Legend:

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

    r1413 r1567  
    1717students_folder = context.portal_url.getPortalObject().campus.students
    1818import logging
    19 logger = logging.getLogger('createReturningStudent')
     19logger = logging.getLogger('Skins.createReturningStudent')
    2020
    2121if not matric_no:
     
    3030    student_brain = res[0]
    3131    sid,jamb_reg_no = context.waeup_tool.createOne(students_folder,student_brain,'?')
    32     logger.info('"%s","Created Student","%s", "%s" ' % (member,sid,matric_no))
     32    logger.info('%s creates student %s %s' % (member,sid,matric_no))
    3333    return "Student MatricNo %s, StudentId %s (JAMBRegNo %s) created" % (matric_no,sid,jamb_reg_no)
    3434
     
    3636count = 1
    3737total = 0
    38 logger.info('"%s","Create Students start"' % (member))
     38logger.info('%s started createReturningStudent"' % (member))
    3939letters = ('ABCDEFGHKLMNPQRSTUVWXYZ')
    4040lc = 0
     
    4242    res = context.students_catalog(matric_no = matric_no)
    4343    if len(res) == 1:
    44         #logger.info('"Student already exists","%s"' % (matric_no))
    4544        continue
    4645    elif len(res) > 1:
    47         logger.info('"Student with multiple entries","%s","%s" ' % (matric_no,len(res)))
     46        logger.info('Student %s with multiple entries (%s)' % (matric_no,len(res)))
     47        # fix at the beginning
    4848        ids = [r.id for r in res if not r.id.startswith('A')]
    49         #from Products.zdb import set_trace;set_trace()
    5049        for id in ids:
    5150            context.students_catalog.deleteRecord(id)
    5251        students_folder.manage_delObjects(ids)
    53         logger.info('"deleted students","%s" ' % " ".join(ids))
     52        logger.info('Student objects deleted: %s' % " ".join(ids))
    5453        continue
    5554    student = context.returning_import(matric_no=matric_no)[0]
     
    5958        lc = 0
    6059    context.waeup_tool.createOne(students_folder,student,letter)
    61     logger.info('"Student created","%s"' % (matric_no))
     60    logger.info('Student created: %s' % (matric_no))
    6261    count += 1
    6362    if count > 10:
    64         logger.info('"%s","Committed Students","%s", "%s" ' % (member,count,total))
     63        logger.info('%s committed students %s, %s' % (member,count,total))
    6564        total += count
    6665        count = 1
    67 logger.info('"%s","Create Students finish","%s"' % (member,total))
     66logger.info('createReturningStudent finished (%s)' % (total))
  • WAeUP_SRP/trunk/skins/waeup_utilities/deleteStudentByMatricNo.py

    r1400 r1567  
    1 ## Script (Python) "search_pins"
     1## Script (Python) "deleteStudentByMatricNo"
    22##bind container=container
    33##bind context=context
     
    1212"""
    1313import logging
    14 logger = logging.getLogger('DeleteStudentByMatricNo')
     14logger = logging.getLogger('Skins.deleteStudentByMatricNo')
    1515
    1616request = REQUEST
     
    2626if str(member) not in ('admin','joachim') or matric_no is None:
    2727    return
    28    
    29    
    30 # remove from students_catalog   
     28
     29
     30# remove from students_catalog
    3131
    3232res = st_cat(matric_no=matric_no)
  • WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelForNewStudents.py

    r1491 r1567  
    1 ## Script (Python) "search_pins"
     1## Script (Python) "fixLevelForNewStudents"
    22##bind container=container
    33##bind context=context
     
    2323setheader = request.RESPONSE.setHeader
    2424import logging
    25 logger = logging.getLogger('fixLevelForNewStudents')
     25logger = logging.getLogger('Skins.fixLevelForNewStudents')
    2626
    2727def rwrite(s):
     
    5353count_full = 0
    5454commit_count = 0
    55 logger.info("started for %s students" % len(res))
     55logger.info("Started for %s students" % len(res))
    5656to_change = {}
    5757for sbrain in res:
     
    9292    if commit_count > 1000:
    9393        context.waeup_tool.doCommit()
    94         logger.info("committing %s transactions total %s" % (commit_count,count))
     94        logger.info("Committing %s transactions, total %s" % (commit_count,count))
    9595        commit_count = 0
    9696    rwrite("%s: %s %s %s <br />" % (count,sbrain.id,entry_mode,level))
     
    9898    students_cat.modifyRecord(**to_change[entry])
    9999rwrite("finished")
    100 logger.info("finished  %s students" % count)
     100logger.info("Finished  %s students" % count)
  • WAeUP_SRP/trunk/skins/waeup_utilities/reindexCoursesCatalog.py

    r1499 r1567  
    1 ## Script (Python) "search_pins"
     1## Script (Python) "reindexCourseCatalog"
    22##bind container=container
    33##bind context=context
     
    2323setheader = request.RESPONSE.setHeader
    2424import logging
    25 logger = logging.getLogger('reindexCourseCatalog')
     25logger = logging.getLogger('Skins.reindexCourseCatalog')
    2626
    2727def rwrite(s):
     
    5151count_full = 0
    5252commit_count = 0
    53 logger.info("reindexing of courses_catalog started for %s courses" % len(courses))
     53logger.info("Reindexing of courses_catalog started for %s courses" % len(courses))
    5454for course_brain in courses:
    5555    course_doc = course_brain.getObject().getContent()
     
    7272    if commit_count > 1000:
    7373        context.waeup_tool.doCommit()
    74         logger.info("committing %s transactions total %s" % (commit_count,count))
     74        logger.info("Committing %s transactions, total %s" % (commit_count,count))
    7575        rwrite("%s: committed %s <br />" % (count,commit_count))
    7676        commit_count = 0
    7777rwrite("finished")
    78 logger.info("finished  reindexing %s courses" % count)
     78logger.info("Reindexing finished (%s courses)" % count)
  • WAeUP_SRP/trunk/skins/waeup_utilities/removeResults2.py

    r1508 r1567  
    1 ## Script (Python) "search_pins"
     1## Script (Python) "removeResults2"
    22##bind container=container
    33##bind context=context
     
    1313"""
    1414import logging
    15 logger = logging.getLogger('removeResults2')
     15logger = logging.getLogger('Skins.removeResults2')
    1616
    1717request = REQUEST
     
    4343        to_del.append(r.key)
    4444        rwrite(r.matric_no + " " + r.Level +"  " + r.CosCode + "<br />")
    45 logger.info('"%s", "start to delete %s results"' % (member,len(to_del)))
     45logger.info('%s starts to delete %s results' % (member,len(to_del)))
    4646for uid in to_del:
    4747    rcat.deleteRecord(uid)
    48 logger.info('"%s", "finished with deletion of %s results"' % (member,len(to_del)))
     48logger.info('%s finished deletion of %s results' % (member,len(to_del)))
    4949rwrite("Done")
    5050
  • WAeUP_SRP/trunk/skins/waeup_utilities/unpay.py

    r1352 r1567  
    1313"""
    1414import logging
    15 logger = logging.getLogger('EPayment.Unpay')
     15logger = logging.getLogger('Skins.unpay')
    1616import DateTime
     17
     18pm = context.portal_membership
     19member = pm.getAuthenticatedMember()
    1720
    1821request = context.REQUEST
     
    2730#wftool.doActionFor(student,'return')
    2831wftool.doActionFor(student,'clear_and_validate')
    29 logger.info('"%s", "reset to state returning"' % student_id)
     32logger.info('%s resets %s to state returning' % (member,student_id))
    3033
    3134return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.