MCPcopy Create free account
hub / github.com/ipython/traitlets / _argcomplete

Method _argcomplete

traitlets/config/loader.py:1126–1139  ·  view source on GitHub ↗

If argcomplete is enabled, allow triggering command-line autocompletion

(self, classes: list[t.Any], subcommands: SubcommandsDict | None)

Source from the content-addressed store, hash-verified

1124 self.log.warning("Unrecognized alias: '%s', it will have no effect.", arg)
1125
1126 def _argcomplete(self, classes: list[t.Any], subcommands: SubcommandsDict | None) -> None:
1127 """If argcomplete is enabled, allow triggering command-line autocompletion"""
1128 try:
1129 import argcomplete # noqa: F401
1130 except ImportError:
1131 return
1132
1133 from . import argcomplete_config
1134
1135 finder = argcomplete_config.ExtendedCompletionFinder() # type:ignore[no-untyped-call]
1136 finder.config_classes = classes
1137 finder.subcommands = list(subcommands or [])
1138 # for ease of testing, pass through self._argcomplete_kwargs if set
1139 finder(self.parser, **getattr(self, "_argcomplete_kwargs", {}))
1140
1141
1142class KeyValueConfigLoader(KVArgParseConfigLoader):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected