MCPcopy Index your code
hub / github.com/python/cpython / cmdloop

Method cmdloop

Lib/pdb.py:2944–2978  ·  view source on GitHub ↗
(self, intro=None)

Source from the content-addressed store, hash-verified

2942 return compfunc(text, line, begidx, endidx)
2943
2944 def cmdloop(self, intro=None):
2945 self.preloop()
2946 if intro is not None:
2947 self.intro = intro
2948 if self.intro:
2949 self.message(str(self.intro))
2950 stop = None
2951 while not stop:
2952 if self._interact_state is not None:
2953 try:
2954 reply = self._get_input(prompt=">>> ", state="interact")
2955 except KeyboardInterrupt:
2956 # Match how KeyboardInterrupt is handled in a REPL
2957 self.message("\nKeyboardInterrupt")
2958 except EOFError:
2959 self.message("\n*exit from pdb interact command*")
2960 self._interact_state = None
2961 else:
2962 self._run_in_python_repl(reply)
2963 continue
2964
2965 if not self.cmdqueue:
2966 try:
2967 state = "commands" if self.commands_defining else "pdb"
2968 reply = self._get_input(prompt=self.prompt, state=state)
2969 except EOFError:
2970 reply = "EOF"
2971
2972 self.cmdqueue.append(reply)
2973
2974 line = self.cmdqueue.pop(0)
2975 line = self.precmd(line)
2976 stop = self.onecmd(line)
2977 stop = self.postcmd(stop, line)
2978 self.postloop()
2979
2980 def postloop(self):
2981 super().postloop()

Callers 3

_cmdloopMethod · 0.45
do_commandsMethod · 0.45
attachFunction · 0.45

Calls 11

messageMethod · 0.95
_get_inputMethod · 0.95
_run_in_python_replMethod · 0.95
postloopMethod · 0.95
strFunction · 0.85
preloopMethod · 0.45
appendMethod · 0.45
popMethod · 0.45
precmdMethod · 0.45
onecmdMethod · 0.45
postcmdMethod · 0.45

Tested by

no test coverage detected