From 984a1b157990f42f8c57815f4b3c00f6455a114f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 8 Oct 2019 16:28:33 -0700 Subject: file cleanup tweaks to actually run --- python/fatcat_tools/cleanups/common.py | 4 ++-- python/fatcat_tools/cleanups/files.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'python') diff --git a/python/fatcat_tools/cleanups/common.py b/python/fatcat_tools/cleanups/common.py index ad2ff858..47607cf1 100644 --- a/python/fatcat_tools/cleanups/common.py +++ b/python/fatcat_tools/cleanups/common.py @@ -39,7 +39,7 @@ class EntityCleaner: self.entity_type = entity_type self.dry_run_mode = kwargs.get('dry_run_mode', True) self.edit_batch_size = kwargs.get('edit_batch_size', 50) - self.editgroup_description = kwargs.get('editgroup_description') + self.editgroup_description = kwargs.get('editgroup_description', "Generic Entity Cleaner Bot") self.editgroup_extra = eg_extra self.reset() self.ac = ApiClient() @@ -93,7 +93,7 @@ class EntityCleaner: if updated: self.counts['updated'] += updated self._edit_count += updated - self._idents.inflight.append(entity.ident) + self._idents_inflight.append(entity.ident) if self._edit_count >= self.edit_batch_size: self.api.accept_editgroup(self._editgroup_id) diff --git a/python/fatcat_tools/cleanups/files.py b/python/fatcat_tools/cleanups/files.py index c2733ba0..ec7e9064 100644 --- a/python/fatcat_tools/cleanups/files.py +++ b/python/fatcat_tools/cleanups/files.py @@ -13,8 +13,7 @@ class FileCleaner(EntityCleaner): def __init__(self, api, **kwargs): - eg_desc = kwargs.pop('editgroup_description', - "Automated cleanup of file entities (eg, remove bad URLs)") + eg_desc = kwargs.pop('editgroup_description', None) or "Automated cleanup of file entities (eg, remove bad URLs)" eg_extra = kwargs.pop('editgroup_extra', dict()) eg_extra['agent'] = eg_extra.get('agent', 'fatcat_tools.FileCleaner') super().__init__(api, @@ -69,6 +68,6 @@ class FileCleaner(EntityCleaner): self.counts['skip-revision'] += 1 return 0 - self.update_file(self.get_editgroup_id(), entity.ident, entity) + self.api.update_file(self.get_editgroup_id(), entity.ident, entity) return 1 -- cgit v1.2.3