Ignore:
Timestamp:
21 Nov 2012, 22:37:03 (12 years ago)
Author:
Henrik Bettermann
Message:

Rework logging of batch processing. Remove redundant text but add name of import file.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/batching.py

    r9701 r9706  
    221221        pass
    222222
    223     def updateEntry(self, obj, row, site):
     223    def updateEntry(self, obj, row, site, filename):
    224224        """Update obj to the values given in row.
    225225        """
     
    264264        # apply other values...
    265265        items_changed += super(ApplicantProcessor, self).updateEntry(
    266             obj, row, site)
     266            obj, row, site, filename)
    267267
    268268        # Log actions...
     
    270270        if self.getLocator(row) == 'container_code':
    271271            parent.__parent__.logger.info(
    272                 'Applicant imported: %s' % items_changed)
     272                '%s - %s - imported: %s' % (self.name, filename, items_changed))
    273273        else:
    274274            parent.__parent__.logger.info(
    275                 'Applicant updated: %s' % items_changed)
     275                '%s - %s - updated: %s' % (self.name, filename, items_changed))
    276276        return items_changed
    277277
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py

    r9293 r9706  
    304304        # create applicant with given application_number
    305305        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, '
    307308            'reg_number=1001, firstname=Aaren, middlename=Peter, lastname=Pieri, '
    308309            'sex=m, course1=CERT1, date_of_birth=1990-01-02, email=xx@yy.zz' in
     
    311312        # not shown in the log file
    312313        self.assertTrue(
    313             'Applicant imported: reg_number=1003, firstname=Aaren, '
     314            'Applicant Processor - sample_applicant_data - imported: '
     315            'reg_number=1003, firstname=Aaren, '
    314316            'middlename=Alfons, lastname=Berson, sex=m, course1=CERT1, '
    315317            'date_of_birth=1990-01-04, email=xx@yy.zz' in
     
    369371        # reg_number is locator
    370372        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
    372375            logcontent)
    373376        # applicant_id is locator
    374377        self.assertTrue(
    375             'Applicant updated: state=admitted, reg_number=6666, '
     378            'Applicant Processor - sample_applicant_data_update - updated: '
     379            'state=admitted, reg_number=6666, '
    376380            'firstname=Alfons, applicant_id=dp2011_2345' in
    377381            logcontent)
Note: See TracChangeset for help on using the changeset viewer.