diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-08-20 02:22:32 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-08-20 02:22:34 -0700 |
commit | 0c400f377bb02c3ea6290de865650f00f1f1abbd (patch) | |
tree | 466582953906b16d3748c1678357b7c362e1d80b /python | |
parent | 2f7cff3c597af42c8dd02313bdceb98a11c2e414 (diff) | |
download | fatcat-0c400f377bb02c3ea6290de865650f00f1f1abbd.tar.gz fatcat-0c400f377bb02c3ea6290de865650f00f1f1abbd.zip |
python autoaccept implementation
More to review:
- duplicate containers getting created in batch mode? eg, if multiple
releases with same container. should push+autoaccept those anyways?
Diffstat (limited to 'python')
-rw-r--r-- | python/fatcat/crossref_importer.py | 2 | ||||
-rw-r--r-- | python/fatcat/importer_common.py | 3 | ||||
-rw-r--r-- | python/fatcat/issn_importer.py | 2 | ||||
-rw-r--r-- | python/fatcat/orcid_importer.py | 2 |
4 files changed, 3 insertions, 6 deletions
diff --git a/python/fatcat/crossref_importer.py b/python/fatcat/crossref_importer.py index d3e525a4..b12851dc 100644 --- a/python/fatcat/crossref_importer.py +++ b/python/fatcat/crossref_importer.py @@ -152,4 +152,4 @@ class FatcatCrossrefImporter(FatcatImporter): re.container_id = container.ident self._issnl_id_map[ce.issnl] = container.ident release_batch.append(re) - self.api.create_release_batch(release_batch) + self.api.create_release_batch(release_batch, autoaccept=True) diff --git a/python/fatcat/importer_common.py b/python/fatcat/importer_common.py index e084d8c4..9949d847 100644 --- a/python/fatcat/importer_common.py +++ b/python/fatcat/importer_common.py @@ -43,10 +43,7 @@ class FatcatImporter: def process_batch(self, source, size=50): """Reads and processes in batches (not API-call-per-)""" for rows in grouper(source, size): - eg = self.api.create_editgroup( - fatcat_client.Editgroup(editor_id='aaaaaaaaaaaabkvkaaaaaaaaae')) self.create_batch(rows, eg.id) - self.api.accept_editgroup(eg.id) def process_csv_source(self, source, group_size=100, delimiter=','): reader = csv.DictReader(source, delimiter=delimiter) diff --git a/python/fatcat/issn_importer.py b/python/fatcat/issn_importer.py index 181137ac..6b806b40 100644 --- a/python/fatcat/issn_importer.py +++ b/python/fatcat/issn_importer.py @@ -70,4 +70,4 @@ class FatcatIssnImporter(FatcatImporter): objects = [o for o in objects if o != None] for o in objects: o.editgroup_id = editgroup_id - self.api.create_container_batch(objects) + self.api.create_container_batch(objects, autoaccept=True) diff --git a/python/fatcat/orcid_importer.py b/python/fatcat/orcid_importer.py index e57703d5..cc12d50d 100644 --- a/python/fatcat/orcid_importer.py +++ b/python/fatcat/orcid_importer.py @@ -71,4 +71,4 @@ class FatcatOrcidImporter(FatcatImporter): objects = [o for o in objects if o != None] for o in objects: o.editgroup_id = editgroup_id - self.api.create_creator_batch(objects) + self.api.create_creator_batch(objects, autoaccept=True) |