External

Wrap extern modules to extras_require.

This module can be called by python -m to check if any fake module imports any variable don’t owned by any true module.

help2man.external.__main__.filter_var(variables: dict[str, Any]) dict[str, Any][source]

Filter var.

Parameters:

variables (dict[str, Any]) –

Return type:

dict[str, Any]

help2man.external.__main__.get_wrong_varnames(file: str, fake_vars: dict[str, Any]) list[str][source]

Get wrong varnames.

Parameters:
  • file (str) –

  • fake_vars (dict[str, Any]) –

Return type:

list[str]

help2man.external.__main__.main() NoReturn[source]

python -m translate_shell.external call this function.

Return type:

NoReturn

help2man.external.__main__.main_once(file: str, fake_vars: dict[str, Any]) NoReturn[source]

python -m translate_shell.external.XXX call this function.

Parameters:
  • file (str) –

  • fake_vars (dict[str, Any]) –

Return type:

NoReturn

help2man.external.__main__.print_wrong_varnames(file: str, fake_vars: dict[str, Any], end: str = '\n') int[source]

Print wrong varnames.

Parameters:
  • file (str) –

  • fake_vars (dict[str, Any]) –

  • end (str) –

Return type:

int

Fake shtab

This module can be called by python -m to check if it imports any variable don’t owned by any true module.

Call --print-completion will warn when shtab is not installed.

https://github.com/iterative/shtab/blob/95b0e3092cd4dcf1ac2871d44cebda01a89992df/shtab/__init__.py#L786-L789

help2man.external.shtab.__main__.add_argument_to(parser: ArgumentParser, *args: Any, **kwargs: Any) ArgumentParser[source]

Add completion argument to parser.

Parameters:
  • parser (ArgumentParser) –

  • args (Any) –

  • kwargs (Any) –

Return type:

ArgumentParser