Changeset 9706 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 21 Nov 2012, 22:37:03 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/batching.py
r9701 r9706 70 70 return 71 71 72 def updateEntry(self, obj, row, site ):72 def updateEntry(self, obj, row, site, filename): 73 73 """Update obj to the values given in row. 74 74 … … 76 76 """ 77 77 items_changed = super(AccessCodeBatchProcessor, self).updateEntry( 78 obj, row, site )78 obj, row, site, filename) 79 79 # Log actions... 80 80 location_field = self.location_fields[0] 81 grok.getSite()['accesscodes'].logger.info('%s - %s - Batch updated: %s' 82 % (self.name, row[location_field], items_changed)) 81 grok.getSite()['accesscodes'].logger.info( 82 '%s - %s - %s - updated: %s' 83 % (self.name, filename, row[location_field], items_changed)) 83 84 return 84 85 … … 180 181 return None 181 182 182 def updateEntry(self, obj, row, site ):183 def updateEntry(self, obj, row, site, filename): 183 184 """Update obj to the values given in row. 184 185 … … 215 216 216 217 items_changed += super(AccessCodeProcessor, self).updateEntry( 217 obj, row, site )218 obj, row, site, filename) 218 219 219 220 # Log actions... 220 grok.getSite()['accesscodes'].logger.info('%s - %s - AC updated: %s' 221 % (self.name, row['representation'], items_changed)) 222 return 221 grok.getSite()['accesscodes'].logger.info( 222 '%s - %s - %s - updated: %s' 223 % (self.name, filename, row['representation'], items_changed)) 224 return -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_batching.py
r9283 r9706 111 111 logcontent = open(self.logfile).read() 112 112 self.assertTrue( 113 'system - AccessCodeBatch Processor - CLR-1 - ' 114 'Batch updated: num=1, creator=system, used_num=1, ' 113 'system - AccessCodeBatch Processor - sample_batch_data - ' 114 'CLR-1 - updated: ' 115 'num=1, creator=system, used_num=1, ' 115 116 'entry_num=3, creation_date=2012-04-28 07:28:48.719026+00:00, ' 116 117 'prefix=CLR, cost=0.0, disabled_num=0' … … 167 168 logcontent = open(self.logfile).read() 168 169 self.assertTrue( 169 'INFO - system - AccessCode Processor - CLR-1-1625368961 - ' 170 'AC updated: state=used, batch_serial=33, random_num=1625368961, ' 170 'INFO - system - AccessCode Processor - sample_ac_data - ' 171 'CLR-1-1625368961 - updated: state=used, ' 172 'batch_serial=33, random_num=1625368961, ' 171 173 'cost=100.0, owner=K1000009' 172 174 in logcontent) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/batching.py
r9701 r9706 221 221 pass 222 222 223 def updateEntry(self, obj, row, site ):223 def updateEntry(self, obj, row, site, filename): 224 224 """Update obj to the values given in row. 225 225 """ … … 264 264 # apply other values... 265 265 items_changed += super(ApplicantProcessor, self).updateEntry( 266 obj, row, site )266 obj, row, site, filename) 267 267 268 268 # Log actions... … … 270 270 if self.getLocator(row) == 'container_code': 271 271 parent.__parent__.logger.info( 272 ' Applicant imported: %s' % items_changed)272 '%s - %s - imported: %s' % (self.name, filename, items_changed)) 273 273 else: 274 274 parent.__parent__.logger.info( 275 ' Applicant updated: %s' % items_changed)275 '%s - %s - updated: %s' % (self.name, filename, items_changed)) 276 276 return items_changed 277 277 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
r9293 r9706 304 304 # create applicant with given application_number 305 305 self.assertTrue( 306 'Applicant imported: applicant_id=dp2011_1234, password=mypwd1, ' 306 'Applicant Processor - sample_applicant_data - imported: ' 307 'applicant_id=dp2011_1234, password=mypwd1, ' 307 308 'reg_number=1001, firstname=Aaren, middlename=Peter, lastname=Pieri, ' 308 309 'sex=m, course1=CERT1, date_of_birth=1990-01-02, email=xx@yy.zz' in … … 311 312 # not shown in the log file 312 313 self.assertTrue( 313 'Applicant imported: reg_number=1003, firstname=Aaren, ' 314 'Applicant Processor - sample_applicant_data - imported: ' 315 'reg_number=1003, firstname=Aaren, ' 314 316 'middlename=Alfons, lastname=Berson, sex=m, course1=CERT1, ' 315 317 'date_of_birth=1990-01-04, email=xx@yy.zz' in … … 369 371 # reg_number is locator 370 372 self.assertTrue( 371 'Applicant updated: reg_number=1001, firstname=Aaren' in 373 'Applicant Processor - sample_applicant_data_update - updated: ' 374 'reg_number=1001, firstname=Aaren' in 372 375 logcontent) 373 376 # applicant_id is locator 374 377 self.assertTrue( 375 'Applicant updated: state=admitted, reg_number=6666, ' 378 'Applicant Processor - sample_applicant_data_update - updated: ' 379 'state=admitted, reg_number=6666, ' 376 380 'firstname=Alfons, applicant_id=dp2011_2345' in 377 381 logcontent) -
main/waeup.kofa/trunk/src/waeup/kofa/authentication.py
r9313 r9706 426 426 return 427 427 428 def updateEntry(self, obj, row, site ):428 def updateEntry(self, obj, row, site, filename): 429 429 """Update obj to the values given in row. 430 430 """ … … 451 451 # Log actions... 452 452 items_changed = ', '.join(changed) 453 grok.getSite().logger.info('%s - %s - updated: %s'454 % (self.name, row['name'], items_changed))453 grok.getSite().logger.info('%s - %s - %s - updated: %s' 454 % (self.name, filename, row['name'], items_changed)) 455 455 return 456 456 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/batching.py
r9312 r9706 62 62 return 63 63 64 def updateEntry(self, obj, row, site ):64 def updateEntry(self, obj, row, site, filename): 65 65 """Update obj to the values given in row. 66 66 """ … … 85 85 location_field = self.location_fields[0] 86 86 items_changed = ', '.join(changed) 87 grok.getSite()['hostels'].logger.info('%s - %s - Record updated: %s' 88 % (self.name, row[location_field], items_changed)) 87 grok.getSite()['hostels'].logger.info( 88 '%s - %s - %s - updated: %s' 89 % (self.name, filename, row[location_field], items_changed)) 89 90 return -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
r9534 r9706 504 504 logcontent = open(self.logfile).read() 505 505 self.assertTrue( 506 "Hostel Processor - block-a-upper-hostel - " 507 "Record updated: beds_for_pre=['G'], floors_per_block=1, " 506 "Hostel Processor - sample_hostel_data - block-a-upper-hostel - " 507 "updated: " 508 "beds_for_pre=['G'], floors_per_block=1, " 508 509 "beds_for_final=['A', 'B'], rooms_per_floor=32, " 509 510 "blocks_for_male=[], hostel_id=block-a-upper-hostel, " -
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r9701 r9706 185 185 return None 186 186 187 def updateEntry(self, obj, row, site ):187 def updateEntry(self, obj, row, site, filename): 188 188 """Update obj to the values given in row. 189 189 """ … … 230 230 # apply other values... 231 231 items_changed += super(StudentProcessor, self).updateEntry( 232 obj, row, site )232 obj, row, site, filename) 233 233 234 234 # Log actions... … … 238 238 # Create mode: the record contains the student_id 239 239 parent.logger.info( 240 '%s - Student recordupdated: %s'241 % ( obj.student_id, items_changed))240 '%s - %s - %s - updated: %s' 241 % (self.name, filename, obj.student_id, items_changed)) 242 242 else: 243 243 # Create mode: the student does not yet exist 244 parent.logger.info('Student data imported: %s' % items_changed) 244 # XXX: It seems that this never happens because student_id 245 # is always set. 246 parent.logger.info( 247 '%s - %s - %s - imported: %s' 248 % (self.name, filename, obj.student_id, items_changed)) 245 249 return items_changed 246 250 … … 418 422 return student.get('studycourse') 419 423 420 def updateEntry(self, obj, row, site ):424 def updateEntry(self, obj, row, site, filename): 421 425 """Update obj to the values given in row. 422 426 """ 423 427 items_changed = super(StudentStudyCourseProcessor, self).updateEntry( 424 obj, row, site )428 obj, row, site, filename) 425 429 parent = self.getParent(row, site) 426 430 parent.__parent__.logger.info( 427 '%s - Study courseupdated: %s'428 % ( parent.student_id, items_changed))431 '%s - %s - %s - updated: %s' 432 % (self.name, filename, parent.student_id, items_changed)) 429 433 # Update the students_catalog 430 434 notify(grok.ObjectModifiedEvent(obj.__parent__)) … … 503 507 return 504 508 505 def updateEntry(self, obj, row, site ):509 def updateEntry(self, obj, row, site, filename): 506 510 """Update obj to the values given in row. 507 511 """ 508 512 items_changed = super(StudentStudyLevelProcessor, self).updateEntry( 509 obj, row, site )513 obj, row, site, filename) 510 514 student = self.getParent(row, site).__parent__ 511 515 student.__parent__.logger.info( 512 '%s - Study levelupdated: %s'513 % (s tudent.student_id, items_changed))516 '%s - %s - %s - updated: %s' 517 % (self.name, filename, student.student_id, items_changed)) 514 518 return 515 519 … … 574 578 return level.get(row['code']) 575 579 576 def updateEntry(self, obj, row, site ):580 def updateEntry(self, obj, row, site, filename): 577 581 """Update obj to the values given in row. 578 582 """ 579 583 items_changed = super(CourseTicketProcessor, self).updateEntry( 580 obj, row, site )584 obj, row, site, filename) 581 585 parent = self.getParent(row, site) 582 586 student = self.getParent(row, site).__parent__.__parent__ 583 587 student.__parent__.logger.info( 584 '%s - Course ticket in %supdated: %s'585 % (s tudent.student_id,parent.level, items_changed))588 '%s - %s - %s - %s - updated: %s' 589 % (self.name, filename, student.student_id, parent.level, items_changed)) 586 590 return 587 591 … … 690 694 return entry 691 695 692 def updateEntry(self, obj, row, site ):696 def updateEntry(self, obj, row, site, filename): 693 697 """Update obj to the values given in row. 694 698 """ 695 699 items_changed = super(StudentOnlinePaymentProcessor, self).updateEntry( 696 obj, row, site )700 obj, row, site, filename) 697 701 student = self.getParent(row, site).__parent__ 698 702 student.__parent__.logger.info( 699 '%s - Payment ticketupdated: %s'700 % (s tudent.student_id, items_changed))703 '%s - %s - %s - updated: %s' 704 % (self.name, filename, student.student_id, items_changed)) 701 705 return 702 706 … … 798 802 return None 799 803 800 def updateEntry(self, obj, row, site ):804 def updateEntry(self, obj, row, site, filename): 801 805 """Update obj to the values given in row. 802 806 """ … … 804 808 vals_to_set = dict((key, val) for key, val in row.items() 805 809 if key not in ('current_session','current_level')) 806 super(StudentVerdictProcessor, self).updateEntry(obj, vals_to_set, site) 810 super(StudentVerdictProcessor, self).updateEntry( 811 obj, vals_to_set, site, filename) 807 812 parent = self.getParent(row, site) 808 813 # Set current_vedict in corresponding studylevel -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r9467 r9706 666 666 # Logging message from updateEntry, 667 667 self.assertTrue( 668 'INFO - system - K1000000 - Study level ' 669 'updated: level=100, level_verdict=C, level_session=2009' 668 'INFO - system - StudentStudyLevel Processor - ' 669 'sample_studylevel_data - K1000000 - updated: ' 670 'level=100, level_verdict=C, level_session=2009' 670 671 in logcontent) 671 672 … … 788 789 self.assertEqual(courseticket.semester, 1) 789 790 shutil.rmtree(os.path.dirname(fin_file)) 790 791 791 logcontent = open(self.logfile).read() 792 792 # Logging message from updateEntry, 793 793 self.assertTrue( 794 'INFO - system - K1000000 - Course ticket in 100 updated: code=COURSE1, ' 794 'INFO - system - CourseTicket Processor - ' 795 'sample_courseticket_data - K1000000 - 100 - ' 796 'updated: code=COURSE1, ' 795 797 'mandatory=False, score=3' 796 798 in logcontent) … … 968 970 # Logging message from updateEntry 969 971 self.assertTrue( 970 'INFO - system - K1000001 - Payment ticket updated: ' 972 'INFO - system - Student Payment Processor - ' 973 'sample_payment_data - K1000001 - updated: ' 971 974 'p_item=BTECHBDT, creation_date=2010-02-15 13:19:01+00:00, ' 972 975 'p_category=schoolfee, amount_auth=19500.0, p_current=True, ' … … 975 978 in logcontent) 976 979 self.assertTrue( 977 'INFO - system - K1000001 - Payment ticket updated: ' 980 'INFO - system - Student Payment Processor - ' 981 'sample_payment_data - K1000001 - updated: ' 978 982 'p_item=BTECHBDT, creation_date=2010-02-15 13:19:01+00:00, ' 979 983 'p_category=schoolfee, amount_auth=19500.6, p_current=True, ' … … 1089 1093 logcontent = open(self.logfile).read() 1090 1094 self.assertMatches( 1091 '... INFO - system - X666666 - Study course updated: current_verdict=0...', 1095 '... INFO - system - Verdict Processor (special processor, ' 1096 'update only) - sample_verdict_data - X666666 - ' 1097 'updated: current_verdict=0...', 1092 1098 logcontent) 1093 1099 self.assertMatches( -
main/waeup.kofa/trunk/src/waeup/kofa/university/batching.py
r9701 r9706 92 92 pass 93 93 94 def updateEntry(self, obj, row, site ):94 def updateEntry(self, obj, row, site, filename): 95 95 """Update obj to the values given in row. 96 96 """ … … 120 120 # apply other values... 121 121 items_changed += super(FacultyProcessor, self).updateEntry( 122 obj, row, site )122 obj, row, site, filename) 123 123 124 124 # Log actions... 125 125 location_field = self.location_fields[0] 126 grok.getSite().logger.info('%s - %s - Recordupdated: %s'127 % (self.name, row[location_field], items_changed))126 grok.getSite().logger.info('%s - %s - %s - updated: %s' 127 % (self.name, filename, row[location_field], items_changed)) 128 128 return items_changed 129 129 -
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
r9265 r9706 205 205 return None 206 206 207 def updateEntry(self, obj, row, site ):207 def updateEntry(self, obj, row, site, filename): 208 208 """Update obj to the values given in row. 209 209 … … 350 350 # student_ids and applicant_ids which have been 351 351 # generated in the respective __init__ methods before. 352 self.updateEntry(obj, row, site )352 self.updateEntry(obj, row, site, base) 353 353 try: 354 354 self.addEntry(obj, row, site) … … 387 387 failed_writer, string_row, update_errors) 388 388 continue 389 self.updateEntry(obj, row, site )389 self.updateEntry(obj, row, site, base) 390 390 finished_writer.writerow(string_row) 391 391 -
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.txt
r8330 r9706 218 218 ... stoneville[row['name']] = obj 219 219 ... 220 ... def updateEntry(self, obj, row, site ):220 ... def updateEntry(self, obj, row, site, filename): 221 221 ... # This is not strictly necessary, as the default 222 222 ... # updateEntry method does exactly the same
Note: See TracChangeset for help on using the changeset viewer.