Refactor class instantiation to remove the need to repeat 'retries' everywhere

This commit is contained in:
JustAnotherArchivist
2021-09-30 09:58:10 +00:00
parent d4567da23c
commit 5e829e2541
8 changed files with 19 additions and 25 deletions

View File

@@ -222,7 +222,7 @@ def _make_scraper(name_, validationFunc, apiField):
@classmethod
def from_args(cls, args):
return cls(getattr(args, name_), submissions = not args.noSubmissions, comments = not args.noComments, before = args.before, after = args.after, retries = args.retries)
return cls._construct(args, getattr(args, name_), submissions = not args.noSubmissions, comments = not args.noComments, before = args.before, after = args.after)
Scraper.__name__ = f'Reddit{name_.capitalize()}Scraper'
Scraper.__qualname__ = Scraper.__name__