From 3d7d372ce326602b274f44338168688eeb907a3b Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sun, 18 Jul 2004 06:25:50 +0000 Subject: [PATCH] Whitespace normalization, via reindent.py. --- Doc/ext/setup.py | 1 - Doc/ext/test.py | 1 - Doc/lib/caseless.py | 4 +--- Doc/lib/email-dir.py | 2 +- Doc/lib/minidom-example.py | 2 +- Doc/lib/required_1.py | 8 ++++---- Doc/ref/reswords.py | 16 ++++++++-------- Doc/tools/custlib.py | 16 ++++++++-------- Doc/tools/keywords.py | 14 +++++++------- Doc/tools/prechm.py | 4 ++-- Doc/tools/sgmlconv/latex2esis.py | 2 +- PC/testpy.py | 30 +++++++++++++++--------------- PCbuild/build_ssl.py | 2 +- 13 files changed, 49 insertions(+), 53 deletions(-) diff --git a/Doc/ext/setup.py b/Doc/ext/setup.py index 1805b177a24..b853d23b170 100644 --- a/Doc/ext/setup.py +++ b/Doc/ext/setup.py @@ -6,4 +6,3 @@ setup(name="noddy", version="1.0", Extension("noddy3", ["noddy3.c"]), Extension("noddy4", ["noddy4.c"]), ]) - diff --git a/Doc/ext/test.py b/Doc/ext/test.py index 10549d685b0..7ebf46afd1e 100644 --- a/Doc/ext/test.py +++ b/Doc/ext/test.py @@ -211,4 +211,3 @@ sys.path.append(src) if __name__ == "__main__": import doctest, __main__ doctest.testmod(__main__) - diff --git a/Doc/lib/caseless.py b/Doc/lib/caseless.py index b1282193375..cae94be911f 100755 --- a/Doc/lib/caseless.py +++ b/Doc/lib/caseless.py @@ -45,7 +45,7 @@ if __name__ == "__main__": print "ok: got OptionConflictError for -H" else: print "not ok: no conflict between -h and -H" - + parser.add_option("-f", "--file", dest="file") #print repr(parser.get_option("-f")) #print repr(parser.get_option("-F")) @@ -58,5 +58,3 @@ if __name__ == "__main__": (options, args) = parser.parse_args(["-F", "bar"]) assert options.file == "bar", options.file print "ok: case insensitive short options work" - - diff --git a/Doc/lib/email-dir.py b/Doc/lib/email-dir.py index bc26b3c98c5..2d89a2fb7e5 100644 --- a/Doc/lib/email-dir.py +++ b/Doc/lib/email-dir.py @@ -66,7 +66,7 @@ def main(): sender = args[0] recips = args[1:] - + # Create the enclosing (outer) message outer = MIMEMultipart() outer['Subject'] = 'Contents of directory %s' % os.path.abspath(dir) diff --git a/Doc/lib/minidom-example.py b/Doc/lib/minidom-example.py index 3fa15dd4587..c30c4e08a94 100644 --- a/Doc/lib/minidom-example.py +++ b/Doc/lib/minidom-example.py @@ -35,7 +35,7 @@ def handleSlideshow(slideshow): def handleSlides(slides): for slide in slides: - handleSlide(slide) + handleSlide(slide) def handleSlide(slide): handleSlideTitle(slide.getElementsByTagName("title")[0]) diff --git a/Doc/lib/required_1.py b/Doc/lib/required_1.py index 44d5b300aac..6be5668eee9 100755 --- a/Doc/lib/required_1.py +++ b/Doc/lib/required_1.py @@ -3,11 +3,11 @@ import optparse class OptionParser (optparse.OptionParser): def check_required (self, opt): - option = self.get_option(opt) + option = self.get_option(opt) - # Assumes the option's 'default' is set to None! - if getattr(self.values, option.dest) is None: - self.error("%s option not supplied" % option) + # Assumes the option's 'default' is set to None! + if getattr(self.values, option.dest) is None: + self.error("%s option not supplied" % option) parser = OptionParser() diff --git a/Doc/ref/reswords.py b/Doc/ref/reswords.py index 29f326fe2ca..68862bbcffe 100644 --- a/Doc/ref/reswords.py +++ b/Doc/ref/reswords.py @@ -11,13 +11,13 @@ def main(): nwords = len(words) nrows = (nwords + ncols - 1) / ncols for irow in range(nrows): - for icol in range(ncols): - i = irow + icol * nrows - if 0 <= i < nwords: - word = words[i] - else: - word = "" - print "%-*s" % (colwidth, word), - print + for icol in range(ncols): + i = irow + icol * nrows + if 0 <= i < nwords: + word = words[i] + else: + word = "" + print "%-*s" % (colwidth, word), + print main() diff --git a/Doc/tools/custlib.py b/Doc/tools/custlib.py index 789892812e4..15f07baf0e5 100644 --- a/Doc/tools/custlib.py +++ b/Doc/tools/custlib.py @@ -10,20 +10,20 @@ modules = {} for modname in sys.builtin_module_names: modules[modname] = modname - + for dir in sys.path: # Look for *.py files filelist = glob.glob(os.path.join(dir, '*.py')) - for file in filelist: + for file in filelist: path, file = os.path.split(file) base, ext = os.path.splitext(file) modules[base.lower()] = base # Look for shared library files - filelist = (glob.glob(os.path.join(dir, '*.so')) + + filelist = (glob.glob(os.path.join(dir, '*.so')) + glob.glob(os.path.join(dir, '*.sl')) + glob.glob(os.path.join(dir, '*.o')) ) - for file in filelist: + for file in filelist: path, file = os.path.split(file) base, ext = os.path.splitext(file) if base[-6:] == 'module': @@ -54,7 +54,7 @@ modules = mlist # Phase III: write custlib.tex # Write the boilerplate -# XXX should be fancied up. +# XXX should be fancied up. print """\documentstyle[twoside,11pt,myformat]{report} \\title{Python Library Reference} \\input{boilerplate} @@ -69,10 +69,10 @@ print """\documentstyle[twoside,11pt,myformat]{report} \\pagebreak {\\parskip = 0mm \\tableofcontents} \\pagebreak\\pagenumbering{arabic}""" - -for modname in mlist: + +for modname in mlist: print "\\input{lib%s}" % (modname,) - + # Write the end print """\\input{custlib.ind} % Index \\end{document}""" diff --git a/Doc/tools/keywords.py b/Doc/tools/keywords.py index 876987de7c0..9f32056db21 100644 --- a/Doc/tools/keywords.py +++ b/Doc/tools/keywords.py @@ -4,16 +4,16 @@ l = [] try: - while 1: - l = l + raw_input().split() + while 1: + l = l + raw_input().split() except EOFError: - pass + pass l.sort() for x in l[:]: - while l.count(x) > 1: l.remove(x) + while l.count(x) > 1: l.remove(x) ncols = 5 nrows = (len(l)+ncols-1)/ncols for i in range(nrows): - for j in range(i, len(l), nrows): - print l[j].ljust(10), - print + for j in range(i, len(l), nrows): + print l[j].ljust(10), + print diff --git a/Doc/tools/prechm.py b/Doc/tools/prechm.py index 09c2c439df5..7b2f3936cec 100644 --- a/Doc/tools/prechm.py +++ b/Doc/tools/prechm.py @@ -438,8 +438,8 @@ def openfile(file): return p def usage(): - print usage_mode - sys.exit(0) + print usage_mode + sys.exit(0) def do_it(args = None): if not args: diff --git a/Doc/tools/sgmlconv/latex2esis.py b/Doc/tools/sgmlconv/latex2esis.py index b30aaa56316..643ef2ca302 100755 --- a/Doc/tools/sgmlconv/latex2esis.py +++ b/Doc/tools/sgmlconv/latex2esis.py @@ -11,7 +11,7 @@ passed to the convert() function; changing this table can allow this tool to support additional LaTeX markups. The format of the table is largely undocumented; see the commented -headers where the table is specified in main(). There is no provision +headers where the table is specified in main(). There is no provision to load an alternate table from an external file. """ diff --git a/PC/testpy.py b/PC/testpy.py index ef8ba7aef44..fd1b1e42f89 100644 --- a/PC/testpy.py +++ b/PC/testpy.py @@ -5,28 +5,28 @@ import sys # change this module too. try: - import string + import string except: - print """Could not import the standard "string" module. -Please check your PYTHONPATH environment variable.""" - sys.exit(1) + print """Could not import the standard "string" module. + Please check your PYTHONPATH environment variable.""" + sys.exit(1) try: - import regex_syntax + import regex_syntax except: - print """Could not import the standard "regex_syntax" module. If this is -a PC, you should add the dos_8x3 directory to your PYTHONPATH.""" - sys.exit(1) + print """Could not import the standard "regex_syntax" module. If this is + a PC, you should add the dos_8x3 directory to your PYTHONPATH.""" + sys.exit(1) import os for dir in sys.path: - file = os.path.join(dir, "string.py") - if os.path.isfile(file): - test = os.path.join(dir, "test") - if os.path.isdir(test): - # Add the "test" directory to PYTHONPATH. - sys.path = sys.path + [test] + file = os.path.join(dir, "string.py") + if os.path.isfile(file): + test = os.path.join(dir, "test") + if os.path.isdir(test): + # Add the "test" directory to PYTHONPATH. + sys.path = sys.path + [test] -import regrtest # Standard Python tester. +import regrtest # Standard Python tester. regrtest.main() diff --git a/PCbuild/build_ssl.py b/PCbuild/build_ssl.py index a369a64ed77..8f485a25809 100644 --- a/PCbuild/build_ssl.py +++ b/PCbuild/build_ssl.py @@ -118,7 +118,7 @@ def main(): # all outputs (debug/nondebug/dll/lib). So we filter the file # to exclude any "nmake" commands and then execute. tempname = "ms\\32all_py.bat" - + in_bat = open("ms\\32all.bat") temp_bat = open(tempname,"w") while 1: