示例#1
0
 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)')
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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)
示例#5
0
 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)')
示例#6
0
 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)