Example #1
0
 def insert_batch(self, batch):
     self.api.create_release_auto_batch(
         fatcat_openapi_client.ReleaseAutoBatch(
             editgroup=fatcat_openapi_client.Editgroup(
                 description=self.editgroup_description,
                 extra=self.editgroup_extra),
             entity_list=batch))
Example #2
0
 def insert_batch(self, batch_batch):
     # there is no batch/bezerk mode for arxiv importer, except for testing
     if self._test_override:
         for batch in batch_batch:
             self.api.create_release_auto_batch(fatcat_openapi_client.ReleaseAutoBatch(
                 editgroup=fatcat_openapi_client.Editgroup(
                     description=self.editgroup_description,
                     extra=self.editgroup_extra),
                 entity_list=batch))
             self.counts['insert'] += len(batch) - 1
     else:
         raise NotImplementedError()
Example #3
0
 def insert_batch(self, batch):
     print('inserting batch ({})'.format(len(batch)), file=sys.stderr)
     if self.insert_log_file:
         with open(self.insert_log_file, 'a') as f:
             for doc in batch:
                 json.dump(entity_to_dict(doc, api_client=None), f)
                 f.write('\n')
     self.api.create_release_auto_batch(
         fatcat_openapi_client.ReleaseAutoBatch(
             editgroup=fatcat_openapi_client.Editgroup(
                 description=self.editgroup_description,
                 extra=self.editgroup_extra),
             entity_list=batch))