Esempio n. 1
0
 def insert_batch(self, batch):
     self.api.create_file_auto_batch(
         fatcat_openapi_client.FileAutoBatch(
             editgroup=fatcat_openapi_client.Editgroup(
                 description=self.editgroup_description,
                 extra=self.editgroup_extra),
             entity_list=batch))
Esempio n. 2
0
 def insert_batch(self, batch: List[FileEntity]) -> None:
     if self.submit_mode:
         eg = self.api.create_editgroup(
             fatcat_openapi_client.Editgroup(
                 description=self.editgroup_description,
                 extra=self.editgroup_extra))
         for fe in batch:
             self.api.create_file(eg.editgroup_id, fe)
         self.api.update_editgroup(eg.editgroup_id, eg, submit=True)
     else:
         self.api.create_file_auto_batch(
             fatcat_openapi_client.FileAutoBatch(
                 editgroup=fatcat_openapi_client.Editgroup(
                     description=self.editgroup_description,
                     extra=self.editgroup_extra),
                 entity_list=batch,
             ))
Esempio n. 3
0
 def insert_batch(self, batch):
     """
     Usually running in submit_mode, so we can't use auto_batch method
     """
     if self.submit_mode:
         eg = self.api.create_editgroup(
             fatcat_openapi_client.Editgroup(
                 description=self.editgroup_description,
                 extra=self.editgroup_extra))
         for fe in batch:
             self.api.create_file(eg.editgroup_id, fe)
         self.api.update_editgroup(eg.editgroup_id, eg, submit=True)
     else:
         self.api.create_file_auto_batch(
             fatcat_openapi_client.FileAutoBatch(
                 editgroup=fatcat_openapi_client.Editgroup(
                     description=self.editgroup_description,
                     extra=self.editgroup_extra),
                 entity_list=batch))