summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/cleanups/files.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-03 14:16:05 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-11-03 16:46:07 -0700
commit45612465cc08114fa19588ea1b0aba0ace1e7b03 (patch)
treedf1381b7b99a0be79ddbabc3c0cfae05b4986a47 /python/fatcat_tools/cleanups/files.py
parent924639f7faf8c2fc1a635c0f27a13d98b47fc453 (diff)
downloadfatcat-45612465cc08114fa19588ea1b0aba0ace1e7b03.tar.gz
fatcat-45612465cc08114fa19588ea1b0aba0ace1e7b03.zip
typing: add annotations to remaining fatcat_tools code
Again, these are just annotations, no changes made to get type checks to pass
Diffstat (limited to 'python/fatcat_tools/cleanups/files.py')
-rw-r--r--python/fatcat_tools/cleanups/files.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/fatcat_tools/cleanups/files.py b/python/fatcat_tools/cleanups/files.py
index d378a91f..309924e3 100644
--- a/python/fatcat_tools/cleanups/files.py
+++ b/python/fatcat_tools/cleanups/files.py
@@ -1,4 +1,4 @@
-from fatcat_openapi_client.models import FileEntity
+from fatcat_openapi_client import ApiClient, FileEntity
from fatcat_openapi_client.rest import ApiException
from .common import EntityCleaner
@@ -9,7 +9,7 @@ class FileCleaner(EntityCleaner):
File fixups!
"""
- def __init__(self, api, **kwargs):
+ def __init__(self, api: ApiClient, **kwargs) -> None:
eg_desc = (
kwargs.pop("editgroup_description", None)
@@ -25,7 +25,7 @@ class FileCleaner(EntityCleaner):
**kwargs
)
- def clean_entity(self, entity):
+ def clean_entity(self, entity: FileEntity) -> FileEntity:
"""
TODO: mimetype is bogus like (???) => clean mimetype
"""
@@ -54,7 +54,7 @@ class FileCleaner(EntityCleaner):
return entity
- def try_update(self, entity):
+ def try_update(self, entity: FileEntity) -> int:
try:
existing = self.api.get_file(entity.ident)