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.
import Wapplication
import W
import os
+import sys
import macfs
import MacOS
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:
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)