summaryrefslogtreecommitdiffstats
path: root/Mac/Contrib/PyIDE-src/PythonIDE.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-08-18 14:59:10 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-08-18 14:59:10 (GMT)
commitcb5704e6a8f4a97d9fc5554df83fa88d058287b9 (patch)
treea2b6032cccb6d4ba130b07fa415d64d613d76e0c /Mac/Contrib/PyIDE-src/PythonIDE.py
parent7cc5735ef26a60df9d1bc3554c1912f951a90308 (diff)
downloadcpython-cb5704e6a8f4a97d9fc5554df83fa88d058287b9.zip
cpython-cb5704e6a8f4a97d9fc5554df83fa88d058287b9.tar.gz
cpython-cb5704e6a8f4a97d9fc5554df83fa88d058287b9.tar.bz2
Initial revision
Diffstat (limited to 'Mac/Contrib/PyIDE-src/PythonIDE.py')
-rw-r--r--Mac/Contrib/PyIDE-src/PythonIDE.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/Mac/Contrib/PyIDE-src/PythonIDE.py b/Mac/Contrib/PyIDE-src/PythonIDE.py
new file mode 100644
index 0000000..e1a94a6
--- /dev/null
+++ b/Mac/Contrib/PyIDE-src/PythonIDE.py
@@ -0,0 +1,57 @@
+# copyright 1997 Just van Rossum, Letterror. just@knoware.nl
+
+# keep this (__main__) as clean as possible, since we are using
+# it like the "normal" interpreter.
+
+__version__ = '0.9b1'
+
+def init():
+ import sys
+ import MacOS
+
+ if sys.version[:5] == '1.5a3':
+ def MyEnableAppswitch(yield,
+ table = {-1:0, 0:-1, 1:1},
+ EnableAppswitch = MacOS.EnableAppswitch):
+ return table[EnableAppswitch(table[yield])]
+ MacOS.EnableAppswitch = MyEnableAppswitch
+
+ MacOS.EnableAppswitch(-1)
+
+ import Qd, QuickDraw
+ Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data)
+
+ import os
+
+ # kludge to keep stdwin's TextEdit.py out the door...
+ import string
+ for i in range(len(sys.path)):
+ path = sys.path[i]
+ if string.find(path, 'stdwin') > 0:
+ del sys.path[i]
+ break
+
+ try:
+ import SpecialKeys # if this succeeds, we should have everything we need inside the applet.
+ del SpecialKeys
+ except ImportError:
+ # personal hack for me
+ wherearewe = os.getcwd()
+ import Res, macfs
+ if os.path.exists(os.path.join(wherearewe, 'IDELib')):
+ sys.path.append(os.path.join(wherearewe, ':IDELib'))
+ sys.path.append(os.path.join(wherearewe, ':IDELib:Widgets'))
+ Res.FSpOpenResFile(macfs.FSSpec(os.path.join(wherearewe, ':IDELib:Resources:Widgets.rsrc')), 1)
+ Res.FSpOpenResFile(macfs.FSSpec(os.path.join(wherearewe, 'PythonIDE.rsrc')), 1)
+ else:
+ oneback = os.path.split(wherearewe)[0]
+ sys.path.append(os.path.join(oneback, ':Fog:Widgets'))
+ Res.FSpOpenResFile(macfs.FSSpec(os.path.join(oneback, ':Fog:Resources:Widgets.rsrc')), 1)
+ Res.FSpOpenResFile(macfs.FSSpec(os.path.join(wherearewe, 'PythonIDE.rsrc')), 1)
+
+init()
+del init
+
+##import trace
+##trace.set_trace()
+import PythonIDEMain