mirror of
https://github.com/python/cpython.git
synced 2025-11-13 15:40:05 +00:00
Normalize style per PEP-8
This commit is contained in:
parent
3e887222aa
commit
7c45632f6d
1 changed files with 34 additions and 35 deletions
|
|
@ -4,7 +4,9 @@ Provides the Distribution class, which represents the module distribution
|
||||||
being built/installed/distributed.
|
being built/installed/distributed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys, os, re
|
import sys
|
||||||
|
import os
|
||||||
|
import re
|
||||||
from email import message_from_file
|
from email import message_from_file
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
@ -39,7 +41,6 @@ class Distribution:
|
||||||
See the code for 'setup()', in core.py, for details.
|
See the code for 'setup()', in core.py, for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# 'global_options' describes the command-line options that may be
|
# 'global_options' describes the command-line options that may be
|
||||||
# supplied to the setup script prior to any actual commands.
|
# supplied to the setup script prior to any actual commands.
|
||||||
# Eg. "./setup.py -n" or "./setup.py --quiet" both take advantage of
|
# Eg. "./setup.py -n" or "./setup.py --quiet" both take advantage of
|
||||||
|
|
@ -48,7 +49,8 @@ class Distribution:
|
||||||
# don't want to pollute the commands with too many options that they
|
# don't want to pollute the commands with too many options that they
|
||||||
# have minimal control over.
|
# have minimal control over.
|
||||||
# The fourth entry for verbose means that it can be repeated.
|
# The fourth entry for verbose means that it can be repeated.
|
||||||
global_options = [('verbose', 'v', "run verbosely (default)", 1),
|
global_options = [
|
||||||
|
('verbose', 'v', "run verbosely (default)", 1),
|
||||||
('quiet', 'q', "run quietly (turns verbosity off)"),
|
('quiet', 'q', "run quietly (turns verbosity off)"),
|
||||||
('dry-run', 'n', "don't actually do anything"),
|
('dry-run', 'n', "don't actually do anything"),
|
||||||
('help', 'h', "show detailed help message"),
|
('help', 'h', "show detailed help message"),
|
||||||
|
|
@ -115,7 +117,6 @@ Common commands: (see '--help-commands' for more)
|
||||||
# negative options are options that exclude other options
|
# negative options are options that exclude other options
|
||||||
negative_opt = {'quiet': 'verbose'}
|
negative_opt = {'quiet': 'verbose'}
|
||||||
|
|
||||||
|
|
||||||
# -- Creation/initialization methods -------------------------------
|
# -- Creation/initialization methods -------------------------------
|
||||||
|
|
||||||
def __init__(self, attrs=None):
|
def __init__(self, attrs=None):
|
||||||
|
|
@ -538,9 +539,9 @@ Common commands: (see '--help-commands' for more)
|
||||||
# known options.
|
# known options.
|
||||||
if not (hasattr(cmd_class, 'user_options') and
|
if not (hasattr(cmd_class, 'user_options') and
|
||||||
isinstance(cmd_class.user_options, list)):
|
isinstance(cmd_class.user_options, list)):
|
||||||
raise DistutilsClassError(("command class %s must provide " +
|
msg = ("command class %s must provide "
|
||||||
"'user_options' attribute (a list of tuples)") % \
|
"'user_options' attribute (a list of tuples)")
|
||||||
cmd_class)
|
raise DistutilsClassError(msg % cmd_class)
|
||||||
|
|
||||||
# If the command class has a list of negative alias options,
|
# If the command class has a list of negative alias options,
|
||||||
# merge it in with the global negative aliases.
|
# merge it in with the global negative aliases.
|
||||||
|
|
@ -557,7 +558,6 @@ Common commands: (see '--help-commands' for more)
|
||||||
else:
|
else:
|
||||||
help_options = []
|
help_options = []
|
||||||
|
|
||||||
|
|
||||||
# All commands support the global options too, just by adding
|
# All commands support the global options too, just by adding
|
||||||
# in 'global_options'.
|
# in 'global_options'.
|
||||||
parser.set_option_table(self.global_options +
|
parser.set_option_table(self.global_options +
|
||||||
|
|
@ -840,7 +840,7 @@ Common commands: (see '--help-commands' for more)
|
||||||
cmd_obj = self.command_obj.get(command)
|
cmd_obj = self.command_obj.get(command)
|
||||||
if not cmd_obj and create:
|
if not cmd_obj and create:
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
self.announce("Distribution.get_command_obj(): " \
|
self.announce("Distribution.get_command_obj(): "
|
||||||
"creating '%s' command object" % command)
|
"creating '%s' command object" % command)
|
||||||
|
|
||||||
klass = self.get_command_class(command)
|
klass = self.get_command_class(command)
|
||||||
|
|
@ -974,7 +974,6 @@ Common commands: (see '--help-commands' for more)
|
||||||
cmd_obj.run()
|
cmd_obj.run()
|
||||||
self.have_run[command] = 1
|
self.have_run[command] = 1
|
||||||
|
|
||||||
|
|
||||||
# -- Distribution query methods ------------------------------------
|
# -- Distribution query methods ------------------------------------
|
||||||
|
|
||||||
def has_pure_modules(self):
|
def has_pure_modules(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue