Changeset 12267 for main/waeup.ikoba/trunk/src/waeup
- Timestamp:
- 20 Dec 2014, 15:59:04 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/batching.py
r12260 r12267 41 41 42 42 43 class PDFDocumentProcessor(BatchProcessor):44 """A ba tch processor for IPDFDocument objects.43 class DocumentProcessorBase(BatchProcessor): 44 """A base for batch processors for IDocument objects. 45 45 """ 46 46 grok.implements(IBatchProcessor) 47 47 grok.provides(IBatchProcessor) 48 48 grok.context(Interface) 49 util_name = 'pdfdocumentprocessor' 50 grok.name(util_name) 49 grok.baseclass() 51 50 52 name = _('Public PDF Document Processor') 53 iface = IPDFDocument 51 util_name = None 52 name = None 53 iface = None 54 54 55 55 location_fields = ['document_id',] 56 factory_name = 'waeup.PDFDocument'56 factory_name = None 57 57 58 58 additional_fields = ['class_name'] … … 98 98 """Update obj to the values given in row. 99 99 """ 100 items_changed = super( PDFDocumentProcessor, self).updateEntry(100 items_changed = super(DocumentProcessorBase, self).updateEntry( 101 101 obj, row, site, filename) 102 102 # Log actions... … … 111 111 """ 112 112 errs, inv_errs, conv_dict = super( 113 PDFDocumentProcessor, self).checkConversion(row, mode=mode)113 DocumentProcessorBase, self).checkConversion(row, mode=mode) 114 114 # We need to check if the class_name corresponds with the 115 115 # processor chosen. This is to avoid accidentally wrong imports. … … 121 121 return errs, inv_errs, conv_dict 122 122 123 class PDFDocumentProcessor(DocumentProcessorBase): 124 """A batch processor for IPDFDocument objects. 125 """ 126 util_name = 'pdfdocumentprocessor' 127 grok.name(util_name) 128 129 name = _('Public PDF Document Processor') 130 iface = IPDFDocument 131 132 factory_name = 'waeup.PDFDocument' 123 133 124 134 class HTMLDocumentProcessor(PDFDocumentProcessor): -
main/waeup.ikoba/trunk/src/waeup/ikoba/utils/tests/test_batching.py
r12178 r12267 188 188 ['name', 'dinoports', 'owner', 'taxpayer'], 189 189 mode='create', user='Bob', logger=self.logger) 190 num _succ, num_fail, finished_path, failed_path = result190 num, num_fail, finished_path, failed_path = result 191 191 self.resultpath = [finished_path, failed_path] 192 assert num _succ== 4192 assert num == 4 193 193 assert num_fail == 0 194 194 assert finished_path.endswith('/newcomers.finished.csv') … … 201 201 ['name', 'dinoports', 'owner', 'taxpayer'], 202 202 mode='create', user='Bob', logger=self.logger) 203 num _succ, num_fail, finished_path, failed_path = result203 num, num_fail, finished_path, failed_path = result 204 204 self.resultpath = [finished_path, failed_path] 205 205 assert len(self.stoneville) == 4 … … 215 215 ['name', 'dinoports', 'owner', 'taxpayer'], 216 216 mode='create', user='Bob', logger=self.logger) 217 num _succ, num_fail, finished_path, failed_path = result217 num, num_fail, finished_path, failed_path = result 218 218 self.resultpath = [finished_path, failed_path] 219 219 assert isinstance(self.stoneville['Barneys Home'].dinoports, int) … … 231 231 ['name', 'dinoports', 'owner', 'taxpayer'], 232 232 mode='create', user='Bob', logger=self.logger) 233 num _succ, num_fail, finished_path, failed_path = result233 num, num_fail, finished_path, failed_path = result 234 234 self.resultpath = [finished_path, failed_path] 235 235 log_contents = open(self.logfile, 'rb').read()
Note: See TracChangeset for help on using the changeset viewer.