diff --git a/IPython/frontend/cocoa/cocoa_frontend.py b/IPython/frontend/cocoa/cocoa_frontend.py index 3c0a46e..576680b 100644 --- a/IPython/frontend/cocoa/cocoa_frontend.py +++ b/IPython/frontend/cocoa/cocoa_frontend.py @@ -306,7 +306,7 @@ class IPythonCocoaController(NSObject, FrontEndBase): def update_cell_prompt(self, result): blockID = result['blockID'] - self.insert_text(self.inputPrompt(result=result), + self.insert_text(self.input_prompt(result=result), textRange=NSMakeRange(self.blockRanges[blockID].location,0), scrollToVisible=False ) @@ -321,7 +321,7 @@ class IPythonCocoaController(NSObject, FrontEndBase): #print inputRange,self.currentBlockRange() self.insert_text('\n' + - self.outputPrompt(result) + + self.output_prompt(result) + result.get('display',{}).get('pprint','') + '\n\n', textRange=NSMakeRange(inputRange.location+inputRange.length, 0)) diff --git a/IPython/frontend/frontendbase.py b/IPython/frontend/frontendbase.py index 195f4ce..9ff9c29 100644 --- a/IPython/frontend/frontendbase.py +++ b/IPython/frontend/frontendbase.py @@ -89,16 +89,16 @@ class IFrontEnd(zi.Interface): pass - def inputPrompt(result={}): + def input_prompt(result={}): """Returns the input prompt by subsituting into self.input_prompt_template""" pass - def outputPrompt(result): + def output_prompt(result): """Returns the output prompt by subsituting into self.output_prompt_template""" pass - def continuationPrompt(): + def continuation_prompt(): """Returns the continuation prompt by subsituting into self.continuation_prompt_template""" pass @@ -157,7 +157,7 @@ class FrontEndBase(object): self.history = history - def inputPrompt(self, result={}): + def input_prompt(self, result={}): """Returns the current input prompt It would be great to use ipython1.core.prompts.Prompt1 here @@ -168,12 +168,12 @@ class FrontEndBase(object): return self.input_prompt_template.safe_substitute(result) - def continuationPrompt(self): + def continuation_prompt(self): """Returns the current continuation prompt""" return self.continuation_prompt_template.safe_substitute() - def outputPrompt(self, result): + def output_prompt(self, result): """Returns the output prompt for result""" return self.output_prompt_template.safe_substitute(result) diff --git a/IPython/frontend/tests/test_frontendbase.py b/IPython/frontend/tests/test_frontendbase.py index 35949c4..be099e6 100644 --- a/IPython/frontend/tests/test_frontendbase.py +++ b/IPython/frontend/tests/test_frontendbase.py @@ -50,18 +50,18 @@ class TestFrontendBase(unittest.TestCase): self.fb = FrontEndCallbackChecker(engine=EngineService()) - def test_implementsIFrontEnd(self): + def test_implements_IFrontEnd(self): assert(frontendbase.IFrontEnd.implementedBy(frontendbase.FrontEndBase)) - def test_is_completeReturnsFalseForIncompleteBlock(self): + def test_is_complete_returns_False_for_incomplete_block(self): """""" block = """def test(a):""" assert(self.fb.is_complete(block) == False) - def test_is_completeReturnsTrueForCompleteBlock(self): + def test_is_complete_returns_True_for_complete_block(self): """""" block = """def test(a): pass""" @@ -73,7 +73,7 @@ class TestFrontendBase(unittest.TestCase): assert(self.fb.is_complete(block)) - def test_blockIDAddedToResult(self): + def test_blockID_added_to_result(self): block = """3+3""" d = self.fb.execute(block, blockID='TEST_ID') @@ -84,7 +84,7 @@ class TestFrontendBase(unittest.TestCase): assert(result['blockID'] == expected) - def test_callbacksAddedToExecuteRequest(self): + def test_callbacks_added_to_execute(self): """test that update_cell_prompt render_result @@ -101,7 +101,7 @@ class TestFrontendBase(unittest.TestCase): assert(self.fb.renderResultCalled) - def test_errorCallbackAddedToExecuteRequest(self): + def test_error_callback_added_to_execute(self): """test that render_error called on execution error""" d = self.fb.execute("raise Exception()")