Mailing List Archive

CVS: python/dist/src/Mac/Tools/IDE PythonIDEMain.py,1.16,1.17
Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE
In directory usw-pr-cvs1:/tmp/cvs-serv30422

Modified Files:
PythonIDEMain.py
Log Message:
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.


Index: PythonIDEMain.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDEMain.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** PythonIDEMain.py 4 Feb 2002 12:48:06 -0000 1.16
--- PythonIDEMain.py 29 Mar 2002 21:23:47 -0000 1.17
***************
*** 7,10 ****
--- 7,11 ----
import W
import os
+ import sys
import macfs
import MacOS
***************
*** 43,49 ****
import PyConsole, PyEdit
Splash.wait()
PyConsole.installoutput()
PyConsole.installconsole()
! import sys
for path in sys.argv[1:]:
self.opendoc(path)
--- 44,57 ----
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()
! if debug_stderr:
! sys.stderr = debug_stderr
for path in sys.argv[1:]:
self.opendoc(path)
***************
*** 171,174 ****
--- 179,184 ----
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: