[Python-checkins] CVS: distutils/distutils/command install_lib.py,1.32,1.33
Greg Ward
python-dev@python.org
Sat, 30 Sep 2000 13:39:12 -0700
Update of /cvsroot/python/distutils/distutils/command
In directory slayer.i.sourceforge.net:/tmp/cvs-serv8083
Modified Files:
install_lib.py
Log Message:
Reduced the 'bytecompile()' method to a one-line wrapper around
'util.byte_compile()'. Currently just reproduces the existing functionality
-- doesn't use any of the fancy features in the new 'byte_compile()'.
Index: install_lib.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/install_lib.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** install_lib.py 2000/09/30 17:35:26 1.32
--- install_lib.py 2000/09/30 20:39:09 1.33
***************
*** 6,9 ****
--- 6,10 ----
from distutils.core import Command
from distutils.dir_util import copy_tree
+ from distutils.util import byte_compile
class install_lib (Command):
***************
*** 83,101 ****
def bytecompile (self, files):
! # XXX hey! we can't control whether we optimize or not; that's up
! # to the invocation of the current Python interpreter (at least
! # according to the py_compile docs). That sucks.
! if self.compile:
! from py_compile import compile
!
! for f in files:
! # only compile the file if it is actually a .py file
! if f[-3:] == '.py':
! out_fn = f + (__debug__ and "c" or "o")
! compile_msg = "byte-compiling %s to %s" % \
! (f, os.path.basename(out_fn))
! skip_msg = "skipping byte-compilation of %s" % f
! self.make_file(f, out_fn, compile, (f,),
! compile_msg, skip_msg)
--- 84,90 ----
def bytecompile (self, files):
! byte_compile(files,
! force=self.force,
! verbose=self.verbose, dry_run=self.dry_run)