[Idle-dev] CVS: idle setup.py,1.5,1.6

Neal Norwitz nnorwitz@users.sourceforge.net
Sat, 30 Nov 2002 09:54:19 -0800


Update of /cvsroot/idlefork/idle
In directory sc8-pr-cvs1:/tmp/cvs-serv21886

Modified Files:
	setup.py 
Log Message:
Port Martin von Loewis checkin from Python:

Add --check-tkinter to setup.py. Install IDLE. Fixes #634078.


Index: setup.py
===================================================================
RCS file: /cvsroot/idlefork/idle/setup.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** setup.py	17 Jul 2001 05:12:42 -0000	1.5
--- setup.py	30 Nov 2002 17:54:17 -0000	1.6
***************
*** 1,3 ****
! import os,glob
  from distutils.core import setup
  from distutils.command.build_py import build_py
--- 1,3 ----
! import os, glob, sys
  from distutils.core import setup
  from distutils.command.build_py import build_py
***************
*** 5,8 ****
--- 5,25 ----
  import idlever
  
+ try:
+     pos = sys.argv.index("--check-tkinter")
+ except ValueError:
+     pass
+ else:
+     del sys.argv[pos]
+     try:
+         import _tkinter
+     except ImportError:
+         print >>sys.stderr, "Cannot install IDLE without _tkinter"
+         raise SystemExit
+ 
+ try:
+     package_dir = os.path.join(os.environ["SRCDIR"], "Tools", "idle")
+ except KeyError:
+     package_dir = "."
+ 
  # name of idle package
  idlelib = "idlelib"
***************
*** 25,29 ****
              dir = os.path.dirname(outfile)
              self.mkpath(dir)
!             self.copy_file(name, outfile, preserve_mode = 0)
          for name in Icons:
              outfile = self.get_plain_outfile(self.build_lib,
--- 42,47 ----
              dir = os.path.dirname(outfile)
              self.mkpath(dir)
!             self.copy_file(os.path.join(package_dir, name), outfile,
!                            preserve_mode = 0)
          for name in Icons:
              outfile = self.get_plain_outfile(self.build_lib,
***************
*** 36,40 ****
      def get_source_files(self):
          # returns the .py files, the .txt files, and the icons
!         icons = [os.path.join("Icons",name) for name in Icons]
          return build_py.get_source_files(self)+txt_files+icons
  
--- 54,59 ----
      def get_source_files(self):
          # returns the .py files, the .txt files, and the icons
!         icons = [os.path.join(package_dir, "Icons",name) for name in Icons]
!         txts = [os.path.join(package_dir, name) for name in txt_files]
          return build_py.get_source_files(self)+txt_files+icons
  
***************
*** 81,86 ****
        cmdclass = {'build_py':idle_build_py,
                    'install_lib':idle_install_lib},
!       package_dir = {idlelib:'.'},
        packages = [idlelib],
!       scripts = ['idle']
        )
--- 100,105 ----
        cmdclass = {'build_py':idle_build_py,
                    'install_lib':idle_install_lib},
!       package_dir = {idlelib: package_dir},
        packages = [idlelib],
!       scripts = [os.path.join(package_dir, 'idle')]
        )