summaryrefslogtreecommitdiffstats
path: root/Mac/Tools/twit/mactwit_app.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-10-23 15:38:26 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-10-23 15:38:26 (GMT)
commit92ca16c3352eb3610551e7d026d38e1636ea6f69 (patch)
tree3e332863a07963e349f6ff02f6d8d1e52ae548bf /Mac/Tools/twit/mactwit_app.py
parentd804bab721208a8691b554443c8cbf1a8ebb6c2d (diff)
downloadcpython-92ca16c3352eb3610551e7d026d38e1636ea6f69.zip
cpython-92ca16c3352eb3610551e7d026d38e1636ea6f69.tar.gz
cpython-92ca16c3352eb3610551e7d026d38e1636ea6f69.tar.bz2
Modified to work together with BBPy
Re-enabled splash screen
Diffstat (limited to 'Mac/Tools/twit/mactwit_app.py')
-rw-r--r--Mac/Tools/twit/mactwit_app.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Mac/Tools/twit/mactwit_app.py b/Mac/Tools/twit/mactwit_app.py
index 2a632da..ed96af5 100644
--- a/Mac/Tools/twit/mactwit_app.py
+++ b/Mac/Tools/twit/mactwit_app.py
@@ -17,6 +17,7 @@ import mactwit_stack
import mactwit_browser
import mactwit_edit
import macfs
+import string
# Resource-id (for checking existence)
ID_MODULES=512
@@ -37,6 +38,7 @@ class Twit(FrameWork.Application, TwitCore.Application, MiniAEFrame.AEServer):
AE.AESetInteractionAllowed(AppleEvents.kAEInteractWithAll)
self.installaehandler('aevt', 'odoc', self.ae_open_doc)
self.installaehandler('aevt', 'quit', self.do_quit)
+ self.installaehandler('pyth', 'EXEC', self.do_bbpyexec) # BBpy execute event
self.dbg_menu_bar = Menu.GetMenuBar()
self.setstate(sessiontype)
@@ -175,6 +177,19 @@ class Twit(FrameWork.Application, TwitCore.Application, MiniAEFrame.AEServer):
fss, changed = object.Resolve()
self.runfile(fss.as_pathname())
+ def do_bbpyexec(self, object=None, NAME=None, **args):
+ if type(object) <> type(''):
+ if AE.AEInteractWithUser(AppleEvents.kAEDefaultTimeout) == 0:
+ EasyDialogs.Message('EXEC AppleEvent arg should be a string')
+ return
+ if self.state <> 'none':
+ if AE.AEInteractWithUser(AppleEvents.kAEDefaultTimeout) == 0:
+ if not self.asknewsession():
+ return
+ stuff = string.splitfields(object, '\r')
+ stuff = string.joinfields(stuff, '\n')
+ self.runstring(stuff)
+
def do_run(self, *args):
if not self.asknewsession():
return