[Idle-dev] CVS: idle PyShell.py,1.4,1.5 setup.py,1.3,1.4

Kurt B. Kaiser kbk@users.sourceforge.net
Sun, 15 Jul 2001 21:00:12 -0700


Update of /cvsroot/idlefork/idle
In directory usw-pr-cvs1:/tmp/cvs-serv5850

Modified Files:
	PyShell.py setup.py 
Log Message:
Add a script "idles" which opens a Python Shell window.

The default behaviour of idlefork idle is to open an editor window instead
of a shell. Complex expressions may be run in a fresh environment by
selecting "run".  There are times, however, when a shell is desired.
Though one can be started by "idle -t 'foo'", this script is more
convenient.  In addition, a shell and an editor window can be started
in parallel by "idles -e foo.py".


Index: PyShell.py
===================================================================
RCS file: /cvsroot/idlefork/idle/PyShell.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** PyShell.py	2001/07/14 05:10:34	1.4
--- PyShell.py	2001/07/16 04:00:10	1.5
***************
*** 3,7 ****
  # changes by dscherer@cmu.edu
  
! #   the main() function has been replaced by a whole class, in order to
  #     address the constraint that only one process can sit on the port
  #     hard-coded into the loader.
--- 3,7 ----
  # changes by dscherer@cmu.edu
  
! #     The main() function has been replaced by a whole class, in order to
  #     address the constraint that only one process can sit on the port
  #     hard-coded into the loader.
***************
*** 14,24 ****
  #     arguments for remotes is still very incomplete.
  
! #   default behavior (no command line options) is to NOT start the Python
! #     Shell.  If files are specified, they are opened, otherwise a single
! #     blank editor window opens.
  
! #   If any command line -options are specified, a shell does appear.  This
! #     is necessary to make the current semantics of the options make sense.
  
  import os
  import spawn
--- 14,26 ----
  #     arguments for remotes is still very incomplete.
  
! #     Default behavior (no command line options) is to open an editor window
! #     instead of starting the Python Shell.  However, if called as
! #     Pyshell.main(0), the Shell will be started instead of the editor window.
  
! #     In the default editor mode, if files are specified, they are opened.
  
+ #     If any command line options are specified, a shell does appear, and if
+ #     the -e option is used, both a shell and an editor window open.
+ 
  import os
  import spawn
***************
*** 726,734 ****
  
  class main:
!     def __init__(self):
          try:
              self.server = protocol.Server(connection_hook = self.address_ok)
              protocol.publish( 'IDLE', self.connect )
!             self.main( sys.argv[1:] )
              return
          except protocol.connectionLost:
--- 728,736 ----
  
  class main:
!     def __init__(self, noshell=1):
          try:
              self.server = protocol.Server(connection_hook = self.address_ok)
              protocol.publish( 'IDLE', self.connect )
!             self.main(sys.argv[1:], noshell)
              return
          except protocol.connectionLost:
***************
*** 776,784 ****
              flist.new()
  
!     def main( self, argv ):
          cmd = None
          edit = 0
-         noshell = 1
-     
          debug = 0
          startup = 0
--- 778,784 ----
              flist.new()
  
!     def main(self, argv, noshell):
          cmd = None
          edit = 0
          debug = 0
          startup = 0

Index: setup.py
===================================================================
RCS file: /cvsroot/idlefork/idle/setup.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** setup.py	2001/07/14 05:48:44	1.3
--- setup.py	2001/07/16 04:00:10	1.4
***************
*** 78,81 ****
        package_dir = {idlelib:'.'},
        packages = [idlelib],
!       scripts = ['idle']
        )
--- 78,81 ----
        package_dir = {idlelib:'.'},
        packages = [idlelib],
!       scripts = ['idle', 'idles']
        )