aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers/matched.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-11-13 12:43:12 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-11-13 12:43:12 -0800
commite8a2925394f4cce0b8b4514f58d2bd19f9d7490b (patch)
treec060f01ac5e3e63d08a28cf38d0ade55267fc893 /python/fatcat_tools/importers/matched.py
parent572fdc7caf74d9539e642e97855d8c8ba94ff93a (diff)
downloadfatcat-e8a2925394f4cce0b8b4514f58d2bd19f9d7490b.tar.gz
fatcat-e8a2925394f4cce0b8b4514f58d2bd19f9d7490b.zip
use Counter object instead of per-metric ints
Diffstat (limited to 'python/fatcat_tools/importers/matched.py')
-rw-r--r--python/fatcat_tools/importers/matched.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/fatcat_tools/importers/matched.py b/python/fatcat_tools/importers/matched.py
index 6270fe88..774019c7 100644
--- a/python/fatcat_tools/importers/matched.py
+++ b/python/fatcat_tools/importers/matched.py
@@ -125,10 +125,10 @@ class FatcatMatchedImporter(FatcatImporter):
if fe is not None:
if fe.ident is None:
self.api.create_file(fe, editgroup=editgroup)
- self.insert_count = self.insert_count + 1
+ self.counts['insert'] += 1
else:
self.api.update_file(fe.ident, fe, editgroup=editgroup)
- self.update_count = self.update_count + 1
+ self.counts['update'] += 1
def create_batch(self, batch, editgroup=None):
"""Reads and processes in batches (not API-call-per-line)"""
@@ -140,5 +140,5 @@ class FatcatMatchedImporter(FatcatImporter):
self.api.update_file(obj.ident, obj, editgroup=editgroup)
if len(new_objects) > 0:
self.api.create_file_batch(new_objects, autoaccept="true", editgroup=editgroup)
- self.update_count = self.update_count + len(update_objects)
- self.insert_count = self.insert_count + len(new_objects)
+ self.counts['update'] += len(update_objects)
+ self.counts['insert'] += len(new_objects)