summaryrefslogtreecommitdiff
path: root/src/distutils2/dist.py
diff options
context:
space:
mode:
authorAntoine Reversat <a.reversat@gmail.com>2010-08-05 21:49:06 -0400
committerAntoine Reversat <a.reversat@gmail.com>2010-08-05 21:49:06 -0400
commitb4a2d7104551bbcc443b0816438fd0d59ea8fdac (patch)
tree372d0599e3a17cc25c1384c6d1c261f05bc54805 /src/distutils2/dist.py
parent7eddff4d019fa891fe42a2b13fbbdfe268ace7af (diff)
downloaddisutils2-b4a2d7104551bbcc443b0816438fd0d59ea8fdac.tar.gz
Changed some files to conform to PEP8
Diffstat (limited to 'src/distutils2/dist.py')
-rw-r--r--src/distutils2/dist.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/distutils2/dist.py b/src/distutils2/dist.py
index c3d547a..cc21d7a 100644
--- a/src/distutils2/dist.py
+++ b/src/distutils2/dist.py
@@ -6,7 +6,9 @@ being built/installed/distributed.
__revision__ = "$Id: dist.py 77717 2010-01-24 00:33:32Z tarek.ziade $"
-import sys, os, re
+import sys
+import os
+import re
try:
import warnings
@@ -26,7 +28,7 @@ from distutils2.metadata import DistributionMetadata
# the same as a Python NAME -- I don't allow leading underscores. The fact
# that they're very similar is no coincidence; the default naming scheme is
# to look for a Python module named after the command.
-command_re = re.compile (r'^[a-zA-Z]([a-zA-Z0-9_]*)$')
+command_re = re.compile(r'^[a-zA-Z]([a-zA-Z0-9_]*)$')
class Distribution(object):
@@ -116,7 +118,7 @@ Common commands: (see '--help-commands' for more)
('use-2to3', None,
"use 2to3 to make source python 3.x compatible"),
('convert-2to3-doctests', None,
- "use 2to3 to convert doctests in seperate text files"),
+ "use 2to3 to convert doctests in seperate text files"),
]
display_option_names = map(lambda x: translate_longopt(x[0]),
display_options)
@@ -124,10 +126,8 @@ Common commands: (see '--help-commands' for more)
# negative options are options that exclude other options
negative_opt = {'quiet': 'verbose'}
-
# -- Creation/initialization methods -------------------------------
-
- def __init__ (self, attrs=None):
+ def __init__(self, attrs=None):
"""Construct a new Distribution instance: initialize all the
attributes of a Distribution, and then use 'attrs' (a dictionary
mapping attribute names to values) to assign some of those
@@ -381,7 +381,7 @@ Common commands: (see '--help-commands' for more)
for opt in options:
if opt != '__name__':
- val = parser.get(section,opt)
+ val = parser.get(section, opt)
opt = opt.replace('-', '_')
opt_dict[opt] = (filename, val)
@@ -555,10 +555,10 @@ Common commands: (see '--help-commands' for more)
if (hasattr(cmd_class, 'help_options') and
isinstance(cmd_class.help_options, list)):
- help_option_found=0
+ help_option_found = 0
for (help_option, short, desc, func) in cmd_class.help_options:
if hasattr(opts, parser.get_attr_name(help_option)):
- help_option_found=1
+ help_option_found = 1
if hasattr(func, '__call__'):
func()
else:
@@ -584,7 +584,7 @@ Common commands: (see '--help-commands' for more)
objects.
"""
if getattr(self, 'convert_2to3_doctests', None):
- self.convert_2to3_doctests = [os.path.join(p)
+ self.convert_2to3_doctests = [os.path.join(p)
for p in self.convert_2to3_doctests]
else:
self.convert_2to3_doctests = []
@@ -797,7 +797,7 @@ Common commands: (see '--help-commands' for more)
class_name = command
try:
- __import__ (module_name)
+ __import__(module_name)
module = sys.modules[module_name]
except ImportError:
continue
@@ -814,7 +814,6 @@ Common commands: (see '--help-commands' for more)
raise DistutilsModuleError("invalid command '%s'" % command)
-
def get_command_obj(self, command, create=1):
"""Return the command object for 'command'. Normally this object
is cached on a previous call to 'get_command_obj()'; if no command
@@ -955,9 +954,7 @@ Common commands: (see '--help-commands' for more)
cmd_obj.run()
self.have_run[command] = 1
-
# -- Distribution query methods ------------------------------------
-
def has_pure_modules(self):
return len(self.packages or self.py_modules or []) > 0