summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/sdist.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/command/sdist.py')
-rw-r--r--Lib/distutils/command/sdist.py37
1 files changed, 11 insertions, 26 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index fbd3c6d..082aa88 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -14,6 +14,7 @@ from distutils import dir_util, dep_util, file_util, archive_util
from distutils.text_file import TextFile
from distutils.errors import *
from distutils.filelist import FileList
+from distutils import log
def show_formats ():
@@ -233,31 +234,17 @@ class sdist (Command):
self.warn(("manifest template '%s' does not exist " +
"(using default file list)") %
self.template)
-
self.filelist.findall()
- # Add default file set to 'files'
if self.use_defaults:
self.add_defaults()
-
- # Read manifest template if it exists
if template_exists:
self.read_template()
-
- # Prune away any directories that don't belong in the source
- # distribution
if self.prune:
self.prune_file_list()
- # File list now complete -- sort it so that higher-level files
- # come first
self.filelist.sort()
-
- # Remove duplicates from the file list
self.filelist.remove_duplicates()
-
- # And write complete file list (including default file set) to
- # the manifest.
self.write_manifest()
# Don't regenerate the manifest, just read it in.
@@ -321,13 +308,12 @@ class sdist (Command):
def read_template (self):
+ """Read and parse manifest template file named by self.template.
- """Read and parse the manifest template file named by
- 'self.template' (usually "MANIFEST.in"). The parsing and
- processing is done by 'self.filelist', which updates itself
- accordingly.
+ (usually "MANIFEST.in") The parsing and processing is done by
+ 'self.filelist', which updates itself accordingly.
"""
- self.announce("reading manifest template '%s'" % self.template)
+ log.info("reading manifest template '%s'", self.template)
template = TextFile(self.template,
strip_comments=1,
skip_blanks=1,
@@ -384,7 +370,7 @@ class sdist (Command):
fill in 'self.filelist', the list of files to include in the source
distribution.
"""
- self.announce("reading manifest file '%s'" % self.manifest)
+ log.info("reading manifest file '%s'", self.manifest)
manifest = open(self.manifest)
while 1:
line = manifest.readline()
@@ -410,8 +396,7 @@ class sdist (Command):
# put 'files' there; the 'mkpath()' is just so we don't die
# if the manifest happens to be empty.
self.mkpath(base_dir)
- dir_util.create_tree(base_dir, files,
- verbose=self.verbose, dry_run=self.dry_run)
+ dir_util.create_tree(base_dir, files, dry_run=self.dry_run)
# And walk over the list of files, either making a hard link (if
# os.link exists) to each one that doesn't already exist in its
@@ -428,12 +413,12 @@ class sdist (Command):
msg = "copying files to %s..." % base_dir
if not files:
- self.warn("no files to distribute -- empty manifest?")
+ log.warn("no files to distribute -- empty manifest?")
else:
- self.announce(msg)
+ log.info(msg)
for file in files:
if not os.path.isfile(file):
- self.warn("'%s' not a regular file -- skipping" % file)
+ log.warn("'%s' not a regular file -- skipping" % file)
else:
dest = os.path.join(base_dir, file)
self.copy_file(file, dest, link=link)
@@ -464,7 +449,7 @@ class sdist (Command):
self.archive_files = archive_files
if not self.keep_temp:
- dir_util.remove_tree(base_dir, self.verbose, self.dry_run)
+ dir_util.remove_tree(base_dir, dry_run=self.dry_run)
def get_archive_files (self):
"""Return the list of archive files created when the command