Changeset 1567 for WAeUP_SRP/trunk
- Timestamp:
- 17 Mar 2007, 08:34:51 (18 years ago)
- 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 17 17 students_folder = context.portal_url.getPortalObject().campus.students 18 18 import logging 19 logger = logging.getLogger(' createReturningStudent')19 logger = logging.getLogger('Skins.createReturningStudent') 20 20 21 21 if not matric_no: … … 30 30 student_brain = res[0] 31 31 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)) 33 33 return "Student MatricNo %s, StudentId %s (JAMBRegNo %s) created" % (matric_no,sid,jamb_reg_no) 34 34 … … 36 36 count = 1 37 37 total = 0 38 logger.info(' "%s","Create Students start"' % (member))38 logger.info('%s started createReturningStudent"' % (member)) 39 39 letters = ('ABCDEFGHKLMNPQRSTUVWXYZ') 40 40 lc = 0 … … 42 42 res = context.students_catalog(matric_no = matric_no) 43 43 if len(res) == 1: 44 #logger.info('"Student already exists","%s"' % (matric_no))45 44 continue 46 45 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 48 48 ids = [r.id for r in res if not r.id.startswith('A')] 49 #from Products.zdb import set_trace;set_trace()50 49 for id in ids: 51 50 context.students_catalog.deleteRecord(id) 52 51 students_folder.manage_delObjects(ids) 53 logger.info(' "deleted students","%s"' % " ".join(ids))52 logger.info('Student objects deleted: %s' % " ".join(ids)) 54 53 continue 55 54 student = context.returning_import(matric_no=matric_no)[0] … … 59 58 lc = 0 60 59 context.waeup_tool.createOne(students_folder,student,letter) 61 logger.info(' "Student created","%s"' % (matric_no))60 logger.info('Student created: %s' % (matric_no)) 62 61 count += 1 63 62 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)) 65 64 total += count 66 65 count = 1 67 logger.info(' "%s","Create Students finish","%s"' % (member,total))66 logger.info('createReturningStudent finished (%s)' % (total)) -
WAeUP_SRP/trunk/skins/waeup_utilities/deleteStudentByMatricNo.py
r1400 r1567 1 ## Script (Python) " search_pins"1 ## Script (Python) "deleteStudentByMatricNo" 2 2 ##bind container=container 3 3 ##bind context=context … … 12 12 """ 13 13 import logging 14 logger = logging.getLogger(' DeleteStudentByMatricNo')14 logger = logging.getLogger('Skins.deleteStudentByMatricNo') 15 15 16 16 request = REQUEST … … 26 26 if str(member) not in ('admin','joachim') or matric_no is None: 27 27 return 28 29 30 # remove from students_catalog 28 29 30 # remove from students_catalog 31 31 32 32 res = 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" 2 2 ##bind container=container 3 3 ##bind context=context … … 23 23 setheader = request.RESPONSE.setHeader 24 24 import logging 25 logger = logging.getLogger(' fixLevelForNewStudents')25 logger = logging.getLogger('Skins.fixLevelForNewStudents') 26 26 27 27 def rwrite(s): … … 53 53 count_full = 0 54 54 commit_count = 0 55 logger.info(" started for %s students" % len(res))55 logger.info("Started for %s students" % len(res)) 56 56 to_change = {} 57 57 for sbrain in res: … … 92 92 if commit_count > 1000: 93 93 context.waeup_tool.doCommit() 94 logger.info(" committing %s transactionstotal %s" % (commit_count,count))94 logger.info("Committing %s transactions, total %s" % (commit_count,count)) 95 95 commit_count = 0 96 96 rwrite("%s: %s %s %s <br />" % (count,sbrain.id,entry_mode,level)) … … 98 98 students_cat.modifyRecord(**to_change[entry]) 99 99 rwrite("finished") 100 logger.info(" finished %s students" % count)100 logger.info("Finished %s students" % count) -
WAeUP_SRP/trunk/skins/waeup_utilities/reindexCoursesCatalog.py
r1499 r1567 1 ## Script (Python) " search_pins"1 ## Script (Python) "reindexCourseCatalog" 2 2 ##bind container=container 3 3 ##bind context=context … … 23 23 setheader = request.RESPONSE.setHeader 24 24 import logging 25 logger = logging.getLogger(' reindexCourseCatalog')25 logger = logging.getLogger('Skins.reindexCourseCatalog') 26 26 27 27 def rwrite(s): … … 51 51 count_full = 0 52 52 commit_count = 0 53 logger.info(" reindexing of courses_catalog started for %s courses" % len(courses))53 logger.info("Reindexing of courses_catalog started for %s courses" % len(courses)) 54 54 for course_brain in courses: 55 55 course_doc = course_brain.getObject().getContent() … … 72 72 if commit_count > 1000: 73 73 context.waeup_tool.doCommit() 74 logger.info(" committing %s transactionstotal %s" % (commit_count,count))74 logger.info("Committing %s transactions, total %s" % (commit_count,count)) 75 75 rwrite("%s: committed %s <br />" % (count,commit_count)) 76 76 commit_count = 0 77 77 rwrite("finished") 78 logger.info(" finished reindexing %s courses" % count)78 logger.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" 2 2 ##bind container=container 3 3 ##bind context=context … … 13 13 """ 14 14 import logging 15 logger = logging.getLogger(' removeResults2')15 logger = logging.getLogger('Skins.removeResults2') 16 16 17 17 request = REQUEST … … 43 43 to_del.append(r.key) 44 44 rwrite(r.matric_no + " " + r.Level +" " + r.CosCode + "<br />") 45 logger.info(' "%s", "start to delete %s results"' % (member,len(to_del)))45 logger.info('%s starts to delete %s results' % (member,len(to_del))) 46 46 for uid in to_del: 47 47 rcat.deleteRecord(uid) 48 logger.info(' "%s", "finished with deletion of %s results"' % (member,len(to_del)))48 logger.info('%s finished deletion of %s results' % (member,len(to_del))) 49 49 rwrite("Done") 50 50 -
WAeUP_SRP/trunk/skins/waeup_utilities/unpay.py
r1352 r1567 13 13 """ 14 14 import logging 15 logger = logging.getLogger(' EPayment.Unpay')15 logger = logging.getLogger('Skins.unpay') 16 16 import DateTime 17 18 pm = context.portal_membership 19 member = pm.getAuthenticatedMember() 17 20 18 21 request = context.REQUEST … … 27 30 #wftool.doActionFor(student,'return') 28 31 wftool.doActionFor(student,'clear_and_validate') 29 logger.info(' "%s", "reset to state returning"' % student_id)32 logger.info('%s resets %s to state returning' % (member,student_id)) 30 33 31 34 return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.