From ce8716a3a642d5c5f9b837d82a5f594f34a78e2b 2008-06-13 20:29:11 From: Barry Wark Date: 2008-06-13 20:29:11 Subject: [PATCH] fixed frontendbase.FrontEndBase.is_complete --- diff --git a/IPython/frontend/cocoa/cocoa_frontend.py b/IPython/frontend/cocoa/cocoa_frontend.py index 1fa4207..5f617e7 100644 --- a/IPython/frontend/cocoa/cocoa_frontend.py +++ b/IPython/frontend/cocoa/cocoa_frontend.py @@ -34,6 +34,7 @@ from AppKit import NSApplicationWillTerminateNotification, NSBeep,\ from pprint import saferepr +import IPython from IPython.kernel.engineservice import EngineService, ThreadedEngineService from IPython.frontend.frontendbase import FrontEndBase @@ -160,7 +161,7 @@ class IPythonCocoaController(NSObject, FrontEndBase): def startCLIForTextView(self): """Print banner""" - banner = """IPython1 0.X -- An enhanced Interactive Python.""" + banner = """IPython1 %s -- An enhanced Interactive Python.""" % IPython.__version__ self.insert_text(banner + '\n\n') diff --git a/IPython/frontend/cocoa/examples/.DS_Store b/IPython/frontend/cocoa/examples/.DS_Store index 27cfdda2f20f42a209fd168dbb5da951fce60ce7..33fb2cc3638425cba746b55723dba38a5c9cbc37 100644 GIT binary patch delta 37 tc${l7Xfc@J&&V<{U^gSnWFAH(&XnThoTU8x9LCK&j2GB8vvd6A2LRQj3vd7c delta 30 mc${l7Xfc@J&&WJ6U^gT4WFAJP&5?}j*d{h;Z)WHC%MSpMsR?-i diff --git a/IPython/frontend/cocoa/examples/IPython1Sandbox/.DS_Store b/IPython/frontend/cocoa/examples/IPython1Sandbox/.DS_Store index cd5766cab6629d39b9959b272c98553f296a3384..01ffa4abea539612d2591322ee76c99d5bd2e2da 100644 GIT binary patch delta 18 ac${l7Xfc?uY2!gR_K6qxH?wp6@~ diff --git a/IPython/frontend/frontendbase.py b/IPython/frontend/frontendbase.py index ab7ce6b..ea8aeb8 100644 --- a/IPython/frontend/frontendbase.py +++ b/IPython/frontend/frontendbase.py @@ -191,10 +191,12 @@ class FrontEndBase(object): """ try: - self.compile_ast(block) - return True + ast = self.compile_ast(block) except: return False + + lines = block.split('\n') + return (len(lines)==1 or str(lines[-1])=='') def compile_ast(self, block):