[Python-checkins] distutils2: Run pep8 on d2.util
tarek.ziade
python-checkins at python.org
Sun Dec 26 14:21:45 CET 2010
tarek.ziade pushed d3c6afbb4629 to distutils2:
http://hg.python.org/distutils2/rev/d3c6afbb4629
changeset: 842:d3c6afbb4629
user: ?ric Araujo <merwok at netwok.org>
date: Fri Nov 26 03:32:41 2010 +0100
summary:
Run pep8 on d2.util
files:
distutils2/util.py
diff --git a/distutils2/util.py b/distutils2/util.py
--- a/distutils2/util.py
+++ b/distutils2/util.py
@@ -238,20 +238,20 @@
words.append(s[:end])
break
- if s[end] in string.whitespace: # unescaped, unquoted whitespace: now
- words.append(s[:end]) # we definitely have a word delimiter
+ if s[end] in string.whitespace: # unescaped, unquoted whitespace: now
+ words.append(s[:end]) # we definitely have a word delimiter
s = s[end:].lstrip()
pos = 0
- elif s[end] == '\\': # preserve whatever is being escaped;
- # will become part of the current word
+ elif s[end] == '\\': # preserve whatever is being escaped;
+ # will become part of the current word
s = s[:end] + s[end + 1:]
pos = end + 1
else:
- if s[end] == "'": # slurp singly-quoted string
+ if s[end] == "'": # slurp singly-quoted string
m = _squote_re.match(s, end)
- elif s[end] == '"': # slurp doubly-quoted string
+ elif s[end] == '"': # slurp doubly-quoted string
m = _dquote_re.match(s, end)
else:
raise RuntimeError("this can't happen "
@@ -664,6 +664,7 @@
return ret
+
def splitext(path):
"""Like os.path.splitext, but take off .tar too"""
base, ext = posixpath.splitext(path)
@@ -869,7 +870,8 @@
"command '%s' failed: %s" % (cmd[0], exc[-1]))
if rc != 0:
# and this reflects the command running but failing
- logger.debug("command '%s' failed with exit status %d" % (cmd[0], rc))
+ logger.debug("command '%s' failed with exit status %d",
+ (cmd[0], rc))
raise DistutilsExecError(
"command '%s' failed with exit status %d" % (cmd[0], rc))
@@ -971,6 +973,7 @@
password:%s
"""
+
def get_pypirc_path():
"""Returns rc file path."""
return os.path.join(os.path.expanduser('~'), '.pypirc')
@@ -1048,7 +1051,7 @@
def metadata_to_dict(meta):
"""XXX might want to move it to the Metadata class."""
data = {
- 'metadata_version' : meta.version,
+ 'metadata_version': meta.version,
'name': meta['Name'],
'version': meta['Version'],
'summary': meta['Summary'],
@@ -1079,10 +1082,11 @@
return data
+
# utility functions for 2to3 support
-def run_2to3(files, doctests_only=False, fixer_names=None, options=None,
- explicit=None):
+def run_2to3(files, doctests_only=False, fixer_names=None,
+ options=None, explicit=None):
""" Wrapper function around the refactor() class which
performs the conversions on a list of python files.
Invoke 2to3 on a list of Python files. The files should all come
@@ -1096,7 +1100,6 @@
fixers = []
fixers = get_fixers_from_package('lib2to3.fixes')
-
if fixer_names:
for fixername in fixer_names:
fixers.extend([fixer for fixer in get_fixers_from_package(fixername)])
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list