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

Kurt B. Kaiser kbk@users.sourceforge.net
Fri, 20 Dec 2002 14:40:32 -0800


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

Modified Files:
	setup.py 
Log Message:
Update the setup file:
1. Make it easier to change the package and script installation names.
2. Update the text files transferred to include the .def and new .txt
   files.
3. Update the description and long description, change email to
   python-dev, update the url to point at sourceforge.
4. Rename the build and install classes for clarity.


Index: setup.py
===================================================================
RCS file: /cvsroot/idlefork/idle/setup.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** setup.py	30 Nov 2002 17:54:17 -0000	1.6
--- setup.py	20 Dec 2002 22:40:30 -0000	1.7
***************
*** 5,8 ****
--- 5,10 ----
  import idlever
  
+ idle_name = "idle"
+ 
  try:
      pos = sys.argv.index("--check-tkinter")
***************
*** 18,32 ****
  
  try:
!     package_dir = os.path.join(os.environ["SRCDIR"], "Tools", "idle")
  except KeyError:
      package_dir = "."
  
! # name of idle package
! idlelib = "idlelib"
  
! # the normal build_py would not incorporate the .txt files
! txt_files = ['config-unix.txt','config-win.txt','config.txt', 'help.txt']
  Icons = glob.glob1("Icons","*.gif")
! class idle_build_py(build_py):
      def get_plain_outfile(self, build_dir, package, file):
          # like get_module_outfile, but does not append .py
--- 20,36 ----
  
  try:
!     package_dir = os.path.join(os.environ["SRCDIR"], "Tools", idle_name)
  except KeyError:
      package_dir = "."
  
! # name of package to be installed in site-packages
! pkgname = idle_name + "lib"
  
! # the normal build_py would not incorporate the .txt or config files
! txt_files = ['extend.txt', 'help.txt', 'CREDITS.txt', 'LICENSE.txt']
! txt_files += ['config-extensions.def', 'config-highlight.def',
!               'config-keys.def', 'config-main.def']
  Icons = glob.glob1("Icons","*.gif")
! class IDLE_Builder(build_py):
      def get_plain_outfile(self, build_dir, package, file):
          # like get_module_outfile, but does not append .py
***************
*** 37,43 ****
          # Copies all .py files, then also copies the txt and gif files
          build_py.run(self)
!         assert self.packages == [idlelib]
          for name in txt_files:
!             outfile = self.get_plain_outfile(self.build_lib, [idlelib], name)
              dir = os.path.dirname(outfile)
              self.mkpath(dir)
--- 41,47 ----
          # Copies all .py files, then also copies the txt and gif files
          build_py.run(self)
!         assert self.packages == [pkgname]
          for name in txt_files:
!             outfile = self.get_plain_outfile(self.build_lib, [pkgname], name)
              dir = os.path.dirname(outfile)
              self.mkpath(dir)
***************
*** 46,60 ****
          for name in Icons:
              outfile = self.get_plain_outfile(self.build_lib,
!                                              [idlelib,"Icons"], name)
              dir = os.path.dirname(outfile)
              self.mkpath(dir)
!             self.copy_file(os.path.join("Icons",name),
                             outfile, preserve_mode = 0)
  
      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
  
      def get_outputs(self, include_bytecode=1):
--- 50,64 ----
          for name in Icons:
              outfile = self.get_plain_outfile(self.build_lib,
!                                              [pkgname, "Icons"], name)
              dir = os.path.dirname(outfile)
              self.mkpath(dir)
!             self.copy_file(os.path.join("Icons", name),
                             outfile, preserve_mode = 0)
  
      def get_source_files(self):
!         # returns the .py files, the .txt and .def 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
  
      def get_outputs(self, include_bytecode=1):
***************
*** 65,73 ****
          for name in txt_files:
              filename = self.get_plain_outfile(self.build_lib,
!                                               [idlelib], name)
              outputs.append(filename)
          for name in Icons:
              filename = self.get_plain_outfile(self.build_lib,
!                                               [idlelib,"Icons"], name)
              outputs.append(filename)
          return outputs
--- 69,77 ----
          for name in txt_files:
              filename = self.get_plain_outfile(self.build_lib,
!                                               [pkgname], name)
              outputs.append(filename)
          for name in Icons:
              filename = self.get_plain_outfile(self.build_lib,
!                                               [pkgname, "Icons"], name)
              outputs.append(filename)
          return outputs
***************
*** 76,105 ****
  # get_outputs are bytecode files
  
! class idle_install_lib(install_lib):
      def _bytecode_filenames(self, files):
          files = [n for n in files if n.endswith('.py')]
!         return install_lib._bytecode_filenames(self,files)
  
! setup(name="IDLE",
        version = idlever.IDLE_VERSION,
!       description = "IDLE Fork, the Forked Python IDE",
!       author = "Guido van Rossum",
!       author_email = "guido@python.org",
!       #url =
        long_description =
! """IDLE is a Tkinter based IDE for Python. It is written in 100% pure
! Python and works both on Windows and Unix. It features a multi-window
! text editor with multiple undo, Python colorizing, and many other things,
! as well as a Python shell window and a debugger.
! 
! IDLE Fork is a separate line of development which was initiated by D. Scherer
! at CMU as part of Visual Python.  It features execution in a separate
! process, with a fresh environment for each run. For further details, 
! refer to idlefork.sourceforge.net.""",
! 
!       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')]
        )
--- 80,113 ----
  # get_outputs are bytecode files
  
! class IDLE_Installer(install_lib):
      def _bytecode_filenames(self, files):
          files = [n for n in files if n.endswith('.py')]
!         return install_lib._bytecode_filenames(self, files)
  
! setup(name="IDLEfork",
        version = idlever.IDLE_VERSION,
!       description = "IDLEfork, the Developmental Python IDE",
!       author = "Guido van Rossum et. al.",
!       author_email = "idle-dev@python.org",
!       url = "https://sourceforge.net/projects/idlefork/",
        long_description =
! """IDLE is a Tkinter based IDE for Python. It is written in 100% pure Python
! and works both on Windows and Unix. It features a multi-window text editor with
! multiple undo, Python colorizing, and many other things, as well as a Python
! shell window and a debugger.
! 
! IDLEfork is a separate line of development which was initiated by D. Scherer
! at CMU as part of Visual Python.  It features execution in a separate process
! which is newly initiated for each run.  At version 0.9 the RPC was changed to
! incorporate code by GvR, which supports the debugger.  IDLEfork also
! incorporates a GUI configuration utilility.  For further details, refer to
! idlefork.sourceforge.net.
! 
! """,
! 
!       cmdclass = {'build_py':IDLE_Builder,
!                   'install_lib':IDLE_Installer},
!       package_dir = {pkgname: package_dir},
!       packages = [pkgname],
!       scripts = [os.path.join(package_dir, idle_name)]
        )