From 289e5a1bb6027ae71e9be82ad2398c2878c14127 2008-07-20 23:11:39 From: Gael Varoquaux Date: 2008-07-20 23:11:39 Subject: [PATCH] Make "help()" work. --- diff --git a/IPython/frontend/prefilterfrontend.py b/IPython/frontend/prefilterfrontend.py index 07ac19c..b92d333 100644 --- a/IPython/frontend/prefilterfrontend.py +++ b/IPython/frontend/prefilterfrontend.py @@ -72,6 +72,8 @@ class PrefilterFrontEnd(LineFrontEndBase): self.shell.output_trap = SyncOutputTrap(write_out=self.write, write_err=self.write) + import pydoc + pydoc.help.output = self.shell.output_trap.out def prefilter_input(self, input_string): @@ -114,7 +116,7 @@ class PrefilterFrontEnd(LineFrontEndBase): self.__old_stderr= sys.stderr sys.stdout = Term.cout sys.stderr = Term.cerr - # FIXME: I still need to provide the writelines method + def release_output(self): """ Release all the different captures we have made, diff --git a/IPython/frontend/wx/wx_frontend.py b/IPython/frontend/wx/wx_frontend.py index be1caa1..3123b4e 100644 --- a/IPython/frontend/wx/wx_frontend.py +++ b/IPython/frontend/wx/wx_frontend.py @@ -181,6 +181,7 @@ class WxController(PrefilterFrontEnd, ConsoleWidget): widget handle them, and put our logic afterward. """ current_line_number = self.GetCurrentLine() + # Calltips if event.KeyCode == ord('('): event.Skip() self.do_calltip() @@ -212,6 +213,7 @@ class WxController(PrefilterFrontEnd, ConsoleWidget): new_buffer = self.get_history_next() if new_buffer is not None: self.replace_current_edit_buffer(new_buffer) + # Tab-completion elif event.KeyCode == ord('\t'): last_line = self.get_current_edit_buffer().split('\n')[-1] if not re.match(r'^\s*$', last_line):