mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-12 20:38:29 +03:00
Refactor class instantiation to remove the need to repeat 'retries' everywhere
This commit is contained in:
@@ -207,11 +207,13 @@ class Scraper:
|
||||
return self._request('POST', *args, **kwargs)
|
||||
|
||||
@classmethod
|
||||
@abc.abstractmethod
|
||||
def setup_parser(cls, subparser):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
@abc.abstractmethod
|
||||
def from_args(cls, args):
|
||||
pass
|
||||
return cls._construct(args)
|
||||
|
||||
@classmethod
|
||||
def _construct(cls, argparseArgs, *args, **kwargs):
|
||||
return cls(*args, **kwargs, retries = argparseArgs.retries)
|
||||
|
||||
Reference in New Issue
Block a user