mirror of https://github.com/scrapy/scrapy.git
fix: deprecate ScrapyCommand.help() which is never called
The help() method claimed it would be displayed by the 'help' command, but that command doesn't exist and the method is never invoked by the framework. Added deprecation warning so subclasses use long_desc() instead.
This commit is contained in:
parent
fada8be1db
commit
cb28d74867
|
|
@ -71,7 +71,19 @@ class ScrapyCommand(ABC):
|
|||
"""An extensive help for the command. It will be shown when using the
|
||||
"help" command. It can contain newlines since no post-formatting will
|
||||
be applied to its contents.
|
||||
|
||||
.. deprecated::
|
||||
This method is never called by the framework. Use ``long_desc()``
|
||||
instead. Will be removed in Scrapy 2.15.
|
||||
"""
|
||||
import warnings
|
||||
warnings.warn(
|
||||
"ScrapyCommand.help() is deprecated and never called by the framework. "
|
||||
"
|
||||
"Use long_desc() instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return self.long_desc()
|
||||
|
||||
def add_options(self, parser: argparse.ArgumentParser) -> None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue