[Python-checkins] CVS: distutils/distutils/command bdist_wininst.py,1.1,1.2

Greg Ward python-dev@python.org
Tue, 27 Jun 2000 17:56:23 -0700


Update of /cvsroot/python/distutils/distutils/command
In directory slayer.i.sourceforge.net:/tmp/cvs-serv13321

Modified Files:
	bdist_wininst.py 
Log Message:
Fixed to use 'reinitialize_command()' to fetch "install" and "install_lib"
  command objects.
Various formatting tweaks, typo fixes in comments.

Index: bdist_wininst.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/bdist_wininst.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** bdist_wininst.py	2000/06/27 01:24:38	1.1
--- bdist_wininst.py	2000/06/28 00:56:20	1.2
***************
*** 8,12 ****
  __revision__ = "$Id$"
  
! import os, sys
  from distutils.core import Command
  from distutils.util import get_platform, create_tree, remove_tree
--- 8,12 ----
  __revision__ = "$Id$"
  
! import sys, os, string
  from distutils.core import Command
  from distutils.util import get_platform, create_tree, remove_tree
***************
*** 15,19 ****
  class bdist_wininst (Command):
  
!     description = "create a \"wininst\" built distribution"
  
      user_options = [('bdist-dir=', 'd',
--- 15,19 ----
  class bdist_wininst (Command):
  
!     description = "create an executable installer for MS Windows"
  
      user_options = [('bdist-dir=', 'd',
***************
*** 65,84 ****
          self.run_command ('build')
  
!         # XXX don't use 'self.get_finalized_command()', because it always
!         # runs 'ensure_finalized()' on the command object; we explictly
!         # want a command object that has *not* been finalized, so we can set
!         # options on it!  (The option we set, 'root', is so that we can do
!         # a proper "fake install" using this install command object.)
!         install = self.distribution.get_command_obj('install')
          install.root = self.bdist_dir
  
!         install_lib = self.distribution.get_command_obj('install_lib')
! 
          install_lib.compile = 0
          install_lib.optimize = 0
  
!         # The packager (correct term in distutils speak?) can choose
!         # if pyc and pyo files should be created on the TARGET system
!         # instead at the SOURCE system.
  
  ##        # The compilation can only be done on the SOURCE system
--- 65,77 ----
          self.run_command ('build')
  
!         install = self.reinitialize_command('install')
          install.root = self.bdist_dir
  
!         install_lib = self.reinitialize_command('install_lib')
          install_lib.compile = 0
          install_lib.optimize = 0
  
!         # The packager can choose if .pyc and .pyo files should be created
!         # on the TARGET system instead at the SOURCE system.
  
  ##        # The compilation can only be done on the SOURCE system
***************
*** 96,100 ****
          self.announce ("installing to %s" % self.bdist_dir)
          install.ensure_finalized()
- 
          install.run()
  
--- 89,92 ----
***************
*** 104,111 ****
          # XXX hack! Our archive MUST be relative to sys.prefix
          # XXX What about .install_data, .install_scripts, ...?
          root_dir = install.install_lib
          arcname = self.make_archive (archive_basename, "zip",
!                            root_dir=root_dir)
! 
          self.create_exe (arcname)
  
--- 96,107 ----
          # XXX hack! Our archive MUST be relative to sys.prefix
          # XXX What about .install_data, .install_scripts, ...?
+         # [Perhaps require that all installation dirs be under sys.prefix
+         # on Windows?  this will be acceptable until we start dealing
+         # with Python applications, at which point we should zip up
+         # the application directory -- and again everything can be
+         # under one dir --GPW]
          root_dir = install.install_lib
          arcname = self.make_archive (archive_basename, "zip",
!                                      root_dir=root_dir)
          self.create_exe (arcname)
  
***************
*** 116,139 ****
  
      def create_inifile (self):
!         # create an inifile containing data describing the installation.
          # This could be done without creating a real file, but
!         # a file is (at least) usefull for debugging bdist_wininst.
!         import string
  
          metadata = self.distribution.metadata
  
-         ini_name = "%s.ini" % self.distribution.get_fullname()
- 
          self.announce ("creating %s" % ini_name)
- 
          inifile = open (ini_name, "w")
  
!         # write the [metadata] section. values are written with repr()[1:],
!         # so they do not contain unprintable characters, and are not
!         # surrounded by quote chars
          inifile.write ("[metadata]\n")
  
!         # 'info' will be displayed in the installers dialog box,
!         # describing the items to be installed
          info = metadata.long_description + '\n'
  
--- 112,132 ----
  
      def create_inifile (self):
!         # Create an inifile containing data describing the installation.
          # This could be done without creating a real file, but
!         # a file is (at least) useful for debugging bdist_wininst.
  
          metadata = self.distribution.metadata
+         ini_name = "%s.ini" % metadata.get_fullname()
  
          self.announce ("creating %s" % ini_name)
          inifile = open (ini_name, "w")
  
!         # Write the [metadata] section.  Values are written with
!         # repr()[1:-1], so they do not contain unprintable characters, and
!         # are not surrounded by quote chars.
          inifile.write ("[metadata]\n")
  
!         # 'info' will be displayed in the installer's dialog box,
!         # describing the items to be installed.
          info = metadata.long_description + '\n'
  
***************
*** 174,178 ****
  
          installer_name = "%s.win32.exe" % self.distribution.get_fullname()
- 
          self.announce ("creating %s" % installer_name)
  
--- 167,170 ----