summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author?ric Araujo <merwok@netwok.org>2010-08-08 02:48:27 +0200
committer?ric Araujo <merwok@netwok.org>2010-08-08 02:48:27 +0200
commit760df097438dff3b81fc0d12a4cddcf723dbf6c4 (patch)
tree137616b810ebca712b7e8b6cc511fe96a39e6eb6 /src
parented993217835aac361f665cbc6a46414466f83b4b (diff)
downloaddisutils2-760df097438dff3b81fc0d12a4cddcf723dbf6c4.tar.gz
Style nitpicks
Diffstat (limited to 'src')
-rw-r--r--src/distutils2/command/build_py.py6
-rw-r--r--src/distutils2/command/sdist.py1
-rw-r--r--src/distutils2/dist.py34
3 files changed, 16 insertions, 25 deletions
diff --git a/src/distutils2/command/build_py.py b/src/distutils2/command/build_py.py
index 505ffdd..1a9d18b 100644
--- a/src/distutils2/command/build_py.py
+++ b/src/distutils2/command/build_py.py
@@ -375,8 +375,7 @@ class build_py(Command, Mixin2to3):
sources += [
os.path.join(src_dir, filename)
for package, src_dir, build_dir, filenames in self.data_files
- for filename in filenames
- ]
+ for filename in filenames]
return sources
def get_module_outfile(self, build_dir, package, module):
@@ -399,8 +398,7 @@ class build_py(Command, Mixin2to3):
outputs += [
os.path.join(build_dir, filename)
for package, src_dir, build_dir, filenames in self.data_files
- for filename in filenames
- ]
+ for filename in filenames]
return outputs
diff --git a/src/distutils2/command/sdist.py b/src/distutils2/command/sdist.py
index 464c7fe..4e7764c 100644
--- a/src/distutils2/command/sdist.py
+++ b/src/distutils2/command/sdist.py
@@ -238,7 +238,6 @@ class sdist(Command):
for cmd_name in self.distribution.get_command_names():
cmd_obj = self.get_finalized_command(cmd_name)
self.filelist.extend(cmd_obj.get_source_files())
-
def prune_file_list(self):
"""Prune off branches that might slip into the file list as created
diff --git a/src/distutils2/dist.py b/src/distutils2/dist.py
index 90b3af1..191b146 100644
--- a/src/distutils2/dist.py
+++ b/src/distutils2/dist.py
@@ -699,27 +699,20 @@ Common commands: (see '--help-commands' for more)
def _get_command_groups(self):
"""Helper function to retrieve all the command class names divided
- into "standard commands" (listed in distutils2.command.__all__)
- and "extra commands" (mentioned in self.cmdclass, but not a standard
- command).
+ into standard commands (listed in distutils2.command.__all__)
+ and extra commands (given in self.cmdclass and not standard
+ commands).
"""
- import distutils2.command
- std_commands = distutils2.command.__all__
- is_std = {}
- for cmd in std_commands:
- is_std[cmd] = 1
-
- extra_commands = []
- for cmd in self.cmdclass:
- if not is_std.get(cmd):
- extra_commands.append(cmd)
+ from distutils2.command import __all__ as std_commands
+ extra_commands = [cmd for cmd in self.cmdclass
+ if cmd not in std_commands]
return std_commands, extra_commands
def print_commands(self):
"""Print out a help message listing all available commands with a
- description of each. The list is divided into "standard commands"
- (listed in distutils2.command.__all__) and "extra commands"
- (mentioned in self.cmdclass, but not a standard command). The
+ description of each. The list is divided into standard commands
+ (listed in distutils2.command.__all__) and extra commands
+ (given in self.cmdclass and not standard commands). The
descriptions come from the command class attribute
'description'.
"""
@@ -740,9 +733,10 @@ Common commands: (see '--help-commands' for more)
def get_command_list(self):
"""Get a list of (command, description) tuples.
- The list is divided into "standard commands" (listed in
- distutils2.command.__all__) and "extra commands" (mentioned in
- self.cmdclass, but not a standard command). The descriptions come
+
+ The list is divided into standard commands (listed in
+ distutils2.command.__all__) and extra commands (given in
+ self.cmdclass and not standard commands). The descriptions come
from the command class attribute 'description'.
"""
# Currently this is only used on Mac OS, for the Mac-only GUI
@@ -772,7 +766,7 @@ Common commands: (see '--help-commands' for more)
return pkgs
def get_command_names(self):
- """Return a list of command names."""
+ """Return a list of all command names."""
return [getattr(cls, 'command_name', cls.__name__)
for cls in self.get_command_classes()]