summaryrefslogtreecommitdiffstats
path: root/Mac/Tools/IDE
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2002-03-29 21:23:47 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2002-03-29 21:23:47 (GMT)
commite0ba087d4476c43dd91cdf7779f3eea27c70bc12 (patch)
tree42dcba81896f485d328f26679a5a8378117064dd /Mac/Tools/IDE
parentb2e33fe285a1f998f477202e9379a39488ea518b (diff)
downloadcpython-e0ba087d4476c43dd91cdf7779f3eea27c70bc12.zip
cpython-e0ba087d4476c43dd91cdf7779f3eea27c70bc12.tar.gz
cpython-e0ba087d4476c43dd91cdf7779f3eea27c70bc12.tar.bz2
Allow file without filetype as long as they end in ".py".
Added a -D flag (can really only be specified on OSX commandline) to not revector sys.stderr, for debugging the IDE itself. Not sure whether this should stay.
Diffstat (limited to 'Mac/Tools/IDE')
-rw-r--r--Mac/Tools/IDE/PythonIDEMain.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/Mac/Tools/IDE/PythonIDEMain.py b/Mac/Tools/IDE/PythonIDEMain.py
index 22ad4df..51072e1 100644
--- a/Mac/Tools/IDE/PythonIDEMain.py
+++ b/Mac/Tools/IDE/PythonIDEMain.py
@@ -6,6 +6,7 @@ import FrameWork
import Wapplication
import W
import os
+import sys
import macfs
import MacOS
@@ -42,9 +43,16 @@ class PythonIDE(Wapplication.Application):
self.quitevent)
import PyConsole, PyEdit
Splash.wait()
+ # With -D option (OSX command line only) keep stderr, for debugging the IDE
+ # itself.
+ debug_stderr = None
+ if sys.argv[1] == '-D':
+ debug_stderr = sys.stderr
+ del sys.argv[1]
PyConsole.installoutput()
PyConsole.installconsole()
- import sys
+ if debug_stderr:
+ sys.stderr = debug_stderr
for path in sys.argv[1:]:
self.opendoc(path)
try:
@@ -171,6 +179,8 @@ class PythonIDE(Wapplication.Application):
fcreator, ftype = macfs.FSSpec(path).GetCreatorType()
if ftype == 'TEXT':
self.openscript(path)
+ elif ftype == '\0\0\0\0' and path[-3:] == '.py':
+ self.openscript(path)
else:
W.Message("Can't open file of type '%s'." % ftype)