def upload_records(self, records, from_queue): self.n += 1 self.backend._print( cformat('%{white!}Batch {}:%{reset}').format(self.n)) xml = MARCXMLGenerator.records_to_xml( records) if from_queue else MARCXMLGenerator.objects_to_xml( records) self.backend._print(xml if xml else '(no changes)')
def run_initial_export(self, events): uploader = DebugUploader(self) uploader.run_initial(events) for i, batch in enumerate(grouper(events, 10, skip_missing=True), 1): print print cformat('%{white!}Batch {}:%{reset}').format(i) print MARCXMLGenerator.objects_to_xml(event for event in batch if event is not None) print
def upload_records(self, records, from_queue): xml = MARCXMLGenerator.records_to_xml( records) if from_queue else MARCXMLGenerator.objects_to_xml( records) if xml is not None: self.upload_xml(xml)
def upload_records(self, records, from_queue): self.n += 1 self.backend._print(cformat('%{white!}Batch {}:%{reset}').format(self.n)) xml = MARCXMLGenerator.records_to_xml(records) if from_queue else MARCXMLGenerator.objects_to_xml(records) self.backend._print(xml if xml else '(no changes)')
def upload_records(self, records, from_queue): xml = MARCXMLGenerator.records_to_xml(records) if from_queue else MARCXMLGenerator.objects_to_xml(records) if xml is not None: self.upload_xml(xml)