diff options
Diffstat (limited to 'Lib/distutils/command/sdist.py')
-rw-r--r-- | Lib/distutils/command/sdist.py | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index adaf492..5116868 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -118,7 +118,7 @@ class sdist (Command): "don't know how to create source distributions " + \ "on platform %s" % os.name - bad_format = archive_util.check_archive_formats (self.formats) + bad_format = archive_util.check_archive_formats(self.formats) if bad_format: raise DistutilsOptionError, \ "unknown archive format '%s'" % bad_format @@ -135,12 +135,12 @@ class sdist (Command): # Ensure that all required meta-data is given; warn if not (but # don't die, it's not *that* serious!) - self.check_metadata () + self.check_metadata() # Do whatever it takes to get the list of files to process # (process the manifest template, read an existing manifest, # whatever). File list is accumulated in 'self.filelist'. - self.get_file_list () + self.get_file_list() # If user just wanted us to regenerate the manifest, stop now. if self.manifest_only: @@ -148,7 +148,7 @@ class sdist (Command): # Otherwise, go ahead and create the source distribution tarball, # or zipfile, or whatever. - self.make_distribution () + self.make_distribution() def check_metadata (self): @@ -161,25 +161,25 @@ class sdist (Command): missing = [] for attr in ('name', 'version', 'url'): - if not (hasattr (metadata, attr) and getattr (metadata, attr)): - missing.append (attr) + if not (hasattr(metadata, attr) and getattr(metadata, attr)): + missing.append(attr) if missing: - self.warn ("missing required meta-data: " + - string.join (missing, ", ")) + self.warn("missing required meta-data: " + + string.join(missing, ", ")) if metadata.author: if not metadata.author_email: - self.warn ("missing meta-data: if 'author' supplied, " + - "'author_email' must be supplied too") + self.warn("missing meta-data: if 'author' supplied, " + + "'author_email' must be supplied too") elif metadata.maintainer: if not metadata.maintainer_email: - self.warn ("missing meta-data: if 'maintainer' supplied, " + - "'maintainer_email' must be supplied too") + self.warn("missing meta-data: if 'maintainer' supplied, " + + "'maintainer_email' must be supplied too") else: - self.warn ("missing meta-data: either (author and author_email) " + - "or (maintainer and maintainer_email) " + - "must be supplied") + self.warn("missing meta-data: either (author and author_email) " + + "or (maintainer and maintainer_email) " + + "must be supplied") # check_metadata () @@ -282,41 +282,41 @@ class sdist (Command): standards = [('README', 'README.txt'), self.distribution.script_name] for fn in standards: - if type (fn) is TupleType: + if type(fn) is TupleType: alts = fn got_it = 0 for fn in alts: - if os.path.exists (fn): + if os.path.exists(fn): got_it = 1 - self.filelist.append (fn) + self.filelist.append(fn) break if not got_it: - self.warn ("standard file not found: should have one of " + - string.join (alts, ', ')) + self.warn("standard file not found: should have one of " + + string.join(alts, ', ')) else: - if os.path.exists (fn): - self.filelist.append (fn) + if os.path.exists(fn): + self.filelist.append(fn) else: - self.warn ("standard file '%s' not found" % fn) + self.warn("standard file '%s' not found" % fn) optional = ['test/test*.py', 'setup.cfg'] for pattern in optional: - files = filter (os.path.isfile, glob (pattern)) + files = filter(os.path.isfile, glob(pattern)) if files: - self.filelist.extend (files) + self.filelist.extend(files) if self.distribution.has_pure_modules(): - build_py = self.get_finalized_command ('build_py') - self.filelist.extend (build_py.get_source_files ()) + build_py = self.get_finalized_command('build_py') + self.filelist.extend(build_py.get_source_files()) if self.distribution.has_ext_modules(): - build_ext = self.get_finalized_command ('build_ext') - self.filelist.extend (build_ext.get_source_files ()) + build_ext = self.get_finalized_command('build_ext') + self.filelist.extend(build_ext.get_source_files()) if self.distribution.has_c_libraries(): - build_clib = self.get_finalized_command ('build_clib') - self.filelist.extend (build_clib.get_source_files ()) + build_clib = self.get_finalized_command('build_clib') + self.filelist.extend(build_clib.get_source_files()) # add_defaults () @@ -329,13 +329,13 @@ class sdist (Command): accordingly. """ self.announce("reading manifest template '%s'" % self.template) - template = TextFile (self.template, - strip_comments=1, - skip_blanks=1, - join_lines=1, - lstrip_ws=1, - rstrip_ws=1, - collapse_join=1) + template = TextFile(self.template, + strip_comments=1, + skip_blanks=1, + join_lines=1, + lstrip_ws=1, + rstrip_ws=1, + collapse_join=1) while 1: line = template.readline() @@ -386,14 +386,14 @@ class sdist (Command): distribution. """ self.announce("reading manifest file '%s'" % self.manifest) - manifest = open (self.manifest) + manifest = open(self.manifest) while 1: - line = manifest.readline () + line = manifest.readline() if line == '': # end of file break if line[-1] == '\n': line = line[0:-1] - self.filelist.append (line) + self.filelist.append(line) # read_manifest () @@ -421,7 +421,7 @@ class sdist (Command): # out-of-date, because by default we blow away 'base_dir' when # we're done making the distribution archives.) - if hasattr (os, 'link'): # can make hard links on this system + if hasattr(os, 'link'): # can make hard links on this system link = 'hard' msg = "making hard links in %s..." % base_dir else: # nope, have to copy @@ -431,13 +431,13 @@ class sdist (Command): if not files: self.warn("no files to distribute -- empty manifest?") else: - self.announce (msg) + self.announce(msg) for file in files: if not os.path.isfile(file): self.warn("'%s' not a regular file -- skipping" % file) else: - dest = os.path.join (base_dir, file) - self.copy_file (file, dest, link=link) + dest = os.path.join(base_dir, file) + self.copy_file(file, dest, link=link) # make_release_tree () @@ -455,16 +455,16 @@ class sdist (Command): base_dir = self.distribution.get_fullname() base_name = os.path.join(self.dist_dir, base_dir) - self.make_release_tree (base_dir, self.filelist.files) + self.make_release_tree(base_dir, self.filelist.files) archive_files = [] # remember names of files we create for fmt in self.formats: - file = self.make_archive (base_name, fmt, base_dir=base_dir) + file = self.make_archive(base_name, fmt, base_dir=base_dir) archive_files.append(file) 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, self.verbose, self.dry_run) def get_archive_files (self): """Return the list of archive files created when the command |