]> granicus.if.org Git - python/commitdiff
Whitespace normalization (via reindent.py).
authorTim Peters <tim.peters@gmail.com>
Fri, 26 Aug 2005 15:20:46 +0000 (15:20 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 26 Aug 2005 15:20:46 +0000 (15:20 +0000)
Lib/distutils/dir_util.py
Lib/hashlib.py
Lib/random.py
Lib/test/seq_tests.py
Lib/test/test_generators.py
Lib/test/test_hashlib_speed.py
Lib/test/test_mmap.py
Lib/urllib2.py
Tools/scripts/findnocoding.py
Tools/scripts/pysource.py

index 2248b607cf4e4b79811507da57f4fa03fab85c14..43994db3ffd7708bd3a9a9f9ae9894653ad516be 100644 (file)
@@ -31,7 +31,7 @@ def mkpath (name, mode=0777, verbose=0, dry_run=0):
     global _path_created
 
     # Detect a common bug -- name is None
-    if not isinstance(name, StringTypes):   
+    if not isinstance(name, StringTypes):
         raise DistutilsInternalError, \
               "mkpath: 'name' must be a string (got %r)" % (name,)
 
index 3528699bda5d3c633a5c998f2a161aa1be6e92dd..48fc56cf2b92a2476b8f0db46a3ad9ce22f8eb47 100644 (file)
@@ -107,4 +107,3 @@ except ImportError:
     sha256 = __get_builtin_constructor('sha256')
     sha384 = __get_builtin_constructor('sha384')
     sha512 = __get_builtin_constructor('sha512')
-
index 3e6941e17828a5c1d125ce3b40ebe58a240a797e..b4ad2b38ae9af42aa11dfd9410f434b430e210f1 100644 (file)
@@ -303,7 +303,7 @@ class Random(_random.Random):
         result = [None] * k
         setsize = 21        # size of a small set minus size of an empty list
         if k > 5:
-              setsize += 4 ** _ceil(_log(k * 3, 4)) # table size for big sets
+            setsize += 4 ** _ceil(_log(k * 3, 4)) # table size for big sets
         if n <= setsize:    # is an n-length list smaller than a k-length set
             pool = list(population)
             for i in xrange(k):         # invariant:  non-selected at [0,n-i)
index ae5bba3d6eb62a4136e19a96d25c02702f124e3d..18fb3b786de00c2d0973e0ac0cfec94585be3766 100644 (file)
@@ -228,7 +228,7 @@ class CommonTest(unittest.TestCase):
         class StopCompares:
             def __eq__(self, other):
                 raise DoNotTestEq
-        
+
         checkfirst = self.type2test([1, StopCompares()])
         self.assert_(1 in checkfirst)
         checklast = self.type2test([StopCompares(), 1])
index fb88ffac0a50c18275a3bf22e14ecb99cc1b00d7..d226043ce35b49d59d5547264083c17fc8b0a47b 100644 (file)
@@ -709,18 +709,18 @@ are quite straightforwardly expressed with this Python idiom.
 Ye olde Fibonacci generator, tee style.
 
 >>> def fib():
-... 
+...
 ...     def _isum(g, h):
 ...         while 1:
 ...             yield g.next() + h.next()
-... 
+...
 ...     def _fib():
 ...         yield 1
 ...         yield 2
 ...         fibTail.next() # throw first away
 ...         for res in _isum(fibHead, fibTail):
 ...             yield res
-...   
+...
 ...     fibHead, fibTail, fibRes = tee(_fib(), 3)
 ...     return fibRes
 
index a62d923a73eadc7b62efa2a3cbd1b4ad173d06c5..c84a62bdf332f28411cca4112c9aae00f23c2772 100644 (file)
@@ -90,4 +90,3 @@ test_scaled_msg(scale=212, name='[2*small data]')
 test_scaled_msg(scale=106, name='[small data]')
 test_scaled_msg(scale=creatorFunc().digest_size, name='[digest_size data]')
 test_scaled_msg(scale=10, name='[tiny data]')
-
index a0386ef005e15a879a7c52ba668178fafdf86c89..0b9cea9214c961debb25ddba732f5440c82d395b 100644 (file)
@@ -126,7 +126,7 @@ def test_both():
             f.seek(0, 2)
             verify(f.tell() == 512, 'Underlying file not truncated')
             f.close()
-            verify(m.size() == 512, 'New size not reflected in file') 
+            verify(m.size() == 512, 'New size not reflected in file')
 
         m.close()
 
index 84b4bb39115dc88856480c7dec2512bbf243719a..015fdb51e84c5bd3d905d0d28c35e6cfa49de906 100644 (file)
@@ -1069,7 +1069,7 @@ def parse_keqv_list(l):
 
 def parse_http_list(s):
     """Parse lists as described by RFC 2068 Section 2.
-    
+
     In particular, parse comma-separated lists where the elements of
     the list may include quoted-strings.  A quoted-string could
     contain a comma.  A non-quoted string could have quotes in the
@@ -1101,7 +1101,7 @@ def parse_http_list(s):
 
         if cur == '"':
             quote = True
-        
+
         part += cur
 
     # append last part
index 707bf237023f87914b491a0dd991f91377482dce..e8fc619b80e49da393445857db9a6703eb8c7955 100755 (executable)
@@ -26,8 +26,8 @@ except:
                             if filename.endswith(".py"):
                                 yield os.path.join(root, filename)
     pysource = pysource()
-                
-            
+
+
     print >>sys.stderr, ("The pysource module is not available; "
                          "no sophisticated Python source file search will be done.")
 
@@ -56,19 +56,19 @@ def needs_declaration(fullpath):
 
     line1 = infile.readline()
     line2 = infile.readline()
-    
+
     if get_declaration(line1) or get_declaration(line2):
         # the file does have an encoding declaration, so trust it
         infile.close()
         return False
-    
+
     # check the whole file for non-ASCII characters
     rest = infile.read()
     infile.close()
-    
+
     if has_correct_encoding(line1+line2+rest, "ascii"):
         return False
-    
+
     return True
 
 
@@ -102,5 +102,3 @@ for fullpath in pysource.walk_python_files(args, is_python):
     result = needs_declaration(fullpath)
     if result:
         print fullpath
-
-
index 3b01bfca375d0807db63381a49a7b639b0de135e..d5eb515e2acb995427f781bc17184355cf84c259 100644 (file)
@@ -57,12 +57,12 @@ def looks_like_python(fullpath):
 
     line = infile.readline()
     infile.close()
-    
+
     if binary_re.search(line):
         # file appears to be binary
         print_debug("%s: appears to be binary" % fullpath)
         return False
-        
+
     if fullpath.endswith(".py") or fullpath.endswith(".pyw"):
         return True
     elif "python" in line:
@@ -95,12 +95,12 @@ def walk_python_files(paths, is_python=looks_like_python, exclude_dirs=None):
     paths: a list of files and/or directories to be checked.
     is_python: a function that takes a file name and checks whether it is a
                Python source file
-    exclude_dirs: a list of directory base names that should be excluded in 
+    exclude_dirs: a list of directory base names that should be excluded in
                   the search
     """
     if exclude_dirs is None:
         exclude_dirs=[]
-    
+
     for path in paths:
         print_debug("testing: %s" % path)
         if os.path.isfile(path):