##// END OF EJS Templates
Merge pull request #1396 from takluyver/magic_tb_fix...
Merge pull request #1396 from takluyver/magic_tb_fix In order for the %tb magic to work as expected, no other error can be raised by invoking it. Even if an error is caught immediately, it affects the 'last error' values in sys. This cuts a try/except block out of ip.magic(). Happily, in this case there was a simpler way to do the same thing using `str.partition`

File last commit:

r2661:595fc3b9
r6107:920beabd merge
Show More
IPython1SandboxAppDelegate.py
39 lines | 931 B | text/x-python | PythonLexer
#
# IPython1SandboxAppDelegate.py
# IPython1Sandbox
#
# Created by Barry Wark on 3/4/08.
# Copyright __MyCompanyName__ 2008. All rights reserved.
#
from Foundation import NSObject, NSPredicate
import objc
import threading
from PyObjCTools import AppHelper
from twisted.internet import reactor
class IPython1SandboxAppDelegate(NSObject):
ipythonController = objc.IBOutlet()
def applicationShouldTerminate_(self, sender):
if reactor.running:
reactor.addSystemEventTrigger(
'after', 'shutdown', AppHelper.stopEventLoop)
reactor.stop()
return False
return True
def applicationDidFinishLaunching_(self, sender):
reactor.interleave(AppHelper.callAfter)
assert(reactor.running)
def workspaceFilterPredicate(self):
return NSPredicate.predicateWithFormat_("NOT (self.value BEGINSWITH '<')")