Commits

Anonymous committed a0005d2

Whitespace normalization.

Comments (0)

Files changed (18)

Lib/ConfigParser.py

     def _interpolate(self, section, option, rawval, vars):
         # do the string interpolation
         value = rawval
-        depth = MAX_INTERPOLATION_DEPTH 
+        depth = MAX_INTERPOLATION_DEPTH
         while depth:                    # Loop through this until it's done
             depth -= 1
             if value.find("%(") != -1:
 __all__ = ["StringIO"]
 
 class StringIO:
-    """class StringIO([buffer]) 
-    
+    """class StringIO([buffer])
+
     When a StringIO object is created, it can be initialized to an existing
     string by passing the string to the constructor. If no string is given,
-    the StringIO will start empty. 
+    the StringIO will start empty.
 
     The StringIO object can accept either Unicode or 8-bit strings, but
     mixing the two may take some care. If both are used, 8-bit strings that
     cannot be interpreted as 7-bit ASCII (that use the 8th bit) will cause
-    a UnicodeError to be raised when getvalue() is called. 
+    a UnicodeError to be raised when getvalue() is called.
     """
     def __init__(self, buf = ''):
         # Force self.buf to be a string or unicode
         but mixing the two may take some care. If both are used, 8-bit
         strings that cannot be interpreted as 7-bit ASCII (that use the
         8th bit) will cause a UnicodeError to be raised when getvalue()
-        is called. 
+        is called.
         """
         if self.buflist:
             self.buf += ''.join(self.buflist)
     Create an instance of the FileInput class. The instance will be used
     as global state for the functions of this module, and is also returned
     to use during iteration. The parameters to this function will be passed
-    along to the constructor of the FileInput class. 
+    along to the constructor of the FileInput class.
     """
     global _state
     if _state and _state._file:
     changed until after the first line of the next file has been read.
     Before the first line has been read, this function has no effect;
     it cannot be used to skip the first file. After the last line of the
-    last file has been read, this function has no effect. 
+    last file has been read, this function has no effect.
     """
     if not _state:
         raise RuntimeError, "no active input()"
 def filename():
     """
     Return the name of the file currently being read.
-    Before the first line has been read, returns None. 
+    Before the first line has been read, returns None.
     """
     if not _state:
         raise RuntimeError, "no active input()"
     """
     Return the cumulative line number of the line that has just been read.
     Before the first line has been read, returns 0. After the last line
-    of the last file has been read, returns the line number of that line. 
+    of the last file has been read, returns the line number of that line.
     """
     if not _state:
         raise RuntimeError, "no active input()"
     """
     Return the line number in the current file. Before the first line
     has been read, returns 0. After the last line of the last file has
-    been read, returns the line number of that line within the file. 
+    been read, returns the line number of that line within the file.
     """
     if not _state:
         raise RuntimeError, "no active input()"
 def isfirstline():
     """
     Returns true the line just read is the first line of its file,
-    otherwise returns false. 
+    otherwise returns false.
     """
     if not _state:
         raise RuntimeError, "no active input()"
 def isstdin():
     """
     Returns true if the last line was read from sys.stdin,
-    otherwise returns false. 
+    otherwise returns false.
     """
     if not _state:
         raise RuntimeError, "no active input()"
 
 class FileInput:
     """class FileInput([files[, inplace[, backup]]])
-    
+
     Class FileInput is the implementation of the module; its methods
     filename(), lineno(), fileline(), isfirstline(), isstdin(), nextfile()
     and close() correspond to the functions of the same name in the module.
     In addition it has a readline() method which returns the next
     input line, and a __getitem__() method which implements the
     sequence behavior. The sequence must be accessed in strictly
-    sequential order; random access and readline() cannot be mixed. 
+    sequential order; random access and readline() cannot be mixed.
     """
 
     def __init__(self, files=None, inplace=0, backup="", bufsize=0):
 
         if self.chunked:
             return self._read_chunked(amt)
-        
+
         if amt is None:
             # unbounded read
             if self.will_close:
         self.close()
 
         return value
-    
+
     def _safe_read(self, amt):
         """Read the number of bytes requested, compensating for partial reads.
 
                 self.esmtp_features["auth"] = self.esmtp_features.get("auth", "") \
                         + " " + auth_match.groups(0)[0]
                 continue
- 
+
             # RFC 1869 requires a space between ehlo keyword and parameters.
             # It's actually stricter, in that only spaces are allowed between
             # parameters, but were not going to check for that here.  Note
 
         def encode_plain(user, password):
             return encode_base64("%s\0%s\0%s" % (user, user, password), eol="")
- 
+
 
         AUTH_PLAIN = "PLAIN"
         AUTH_CRAM_MD5 = "CRAM-MD5"
 
 """The Tab Nanny despises ambiguous indentation.  She knows no mercy.
 
-tabnanny -- Detection of ambiguous indentation 
+tabnanny -- Detection of ambiguous indentation
 
 For the time being this module is intended to be called as a script.
 However it is possible to import it into an IDE and use the function
-check() described below. 
+check() described below.
 
 Warning: The API provided by this module is likely to change in future
-releases; such changes may not be backward compatible. 
+releases; such changes may not be backward compatible.
 """
 
 # Released to the public domain, by Tim Peters, 15 April 1998.
 
 def check(file):
     """check(file_or_dir)
-    
+
     If file_or_dir is a directory and not a symbolic link, then recursively
     descend the directory tree named by file_or_dir, checking all .py files
     along the way. If file_or_dir is an ordinary Python source file, it is
     checked for whitespace related problems. The diagnostic messages are
-    written to standard output using the print statement.     
+    written to standard output using the print statement.
     """
-    
+
     if os.path.isdir(file) and not os.path.islink(file):
         if verbose:
             print "%s: listing directory" % `file`

Lib/test/pickletester.py

         t = time.localtime()
         s = self.dumps(t)
         u = self.loads(s)
-        self.assertEqual(t, u)        
+        self.assertEqual(t, u)
         import os
         if hasattr(os, "stat"):
             t = os.stat(os.curdir)

Lib/test/test_StringIO.py

             # The StringIO module also supports concatenating Unicode
             # snippets to larger Unicode strings. This is tested by this
             # method. Note that cStringIO does not support this extension.
-        
+
             f = self.MODULE.StringIO()
             f.write(self._line[:6])
             f.seek(3)

Lib/test/test_cfgparser.py

 foo = this line is much, much longer than my editor
         likes it.
 """)
-           
+
 def case_sensitivity():
     print "Testing case sensitivity..."
     cf = ConfigParser.ConfigParser()

Lib/test/test_generators.py

 ...             continue
 ...         finally:
 ...             yield i
-... 
+...
 >>> g = f()
 >>> print g.next()
 0

Lib/test/test_httplib.py

 cookies = r.getheader("Set-Cookie")
 if cookies != hdr:
     raise AssertionError, "multiple headers not combined properly"
-               

Lib/test/test_multifile.py

 
 msg = """Mime-Version: 1.0
 Content-Type: multipart/mixed;
-	boundary="=====================_590453667==_"
+        boundary="=====================_590453667==_"
 X-OriginalArrivalTime: 05 Feb 2002 03:43:23.0310 (UTC) FILETIME=[42D88CE0:01C1ADF7]
 
 --=====================_590453667==_
 Content-Type: multipart/alternative;
-	boundary="=====================_590453677==_.ALT"
+        boundary="=====================_590453677==_.ALT"
 
 --=====================_590453677==_.ALT
 Content-Type: text/plain; charset="us-ascii"; format=flowed
         boundaries += 1
 
         mf.push(boundary)
-        while mf.next(): 
-            getMIMEMsg(mf)     
+        while mf.next():
+            getMIMEMsg(mf)
         mf.pop()
     else:
         lines = mf.readlines()

Lib/test/test_netrc.py

 line3
 line4
 
-default login log2 password pass2 
+default login log2 password pass2
 
 """
 
         fp.write(TEST_NETRC)
         fp.close()
         self.netrc = netrc.netrc(temp_filename)
-        
+
     def tearDown (self):
         del self.netrc
         os.unlink(temp_filename)
                                            )
         self.assert_(self.netrc.hosts['foo'] == ('log1', 'acct1', 'pass1'))
         self.assert_(self.netrc.hosts['default'] == ('log2', None, 'pass2'))
-            
-        
+
+
 if __name__ == "__main__":
     test_support.run_unittest(NetrcTestCase)
-

Lib/test/test_string.py

                 value = apply(f, (input,) + args)
             if value is input:
                 if verbose:
-                   print 'no'
+                    print 'no'
                 print '*',f, `input`, `output`, `value`
                 return
     if value != output:

Lib/test/test_trace.py

     sys._getframe().f_back.f_trace = tracefunc
 def settrace_and_return(tracefunc):
     _settrace_and_return(tracefunc)
-    
+
 settrace_and_return.events = [(1, 'return')]
 
 def _settrace_and_raise(tracefunc):
         _settrace_and_raise(tracefunc)
     except RuntimeError, exc:
         pass
-    
+
 settrace_and_raise.events = [(2, 'exception'),
                              (3, 'line'),
                              (4, 'line'),
 
 class TraceTestCase(unittest.TestCase):
     def compare_events(self, line_offset, events, expected_events):
-        events = [(l - line_offset, e) for (l, e) in events]        
+        events = [(l - line_offset, e) for (l, e) in events]
         if events != expected_events:
             self.fail(
                 "events did not match expectation:\n" +
                 "\n".join(difflib.ndiff(map(str, expected_events),
                                         map(str, events))))
-        
-    
+
+
     def run_test(self, func):
         tracer = Tracer()
         sys.settrace(tracer.trace)
         sys.settrace(None)
         self.compare_events(func.func_code.co_firstlineno,
                             tracer.events, func.events)
-    
+
     def test_1_basic(self):
         self.run_test(basic)
     def test_2_arigo(self):
                     self.fail("exception not thrown!")
         except RuntimeError:
             self.fail("recursion counter not reset")
-            
+
 
 def test_main():
     test_support.run_unittest(TraceTestCase)

Lib/test/test_urlparse.py

                        ('http', 'www.python.org', '/', '', '', 'abc')),
                       (RFC1808_BASE,
                        ('http', 'a', '/b/c/d', 'p', 'q', 'f')),
-		      ('file:///tmp/junk.txt',
-		       ('file', '', '/tmp/junk.txt', '', '', '')),
+                      ('file:///tmp/junk.txt',
+                       ('file', '', '/tmp/junk.txt', '', '', '')),
                       ]:
     result = urlparse.urlparse(url)
     print "%-13s = %r" % (url, result)
     """
     The tokenize() function accepts two parameters: one representing the
     input stream, and one providing an output mechanism for tokenize().
-    
+
     The first parameter, readline, must be a callable object which provides
     the same interface as the readline() method of built-in file objects.
-    Each call to the function should return one line of input as a string. 
+    Each call to the function should return one line of input as a string.
 
     The second parameter, tokeneater, must also be a callable object. It is
     called once for each token, with five arguments, corresponding to the
-    tuples generated by generate_tokens(). 
+    tuples generated by generate_tokens().
     """
     try:
         tokenize_loop(readline, tokeneater)
     must be a callable object which provides the same interface as the
     readline() method of built-in file objects. Each call to the function
     should return one line of input as a string.
-    
+
     The generator produces 5-tuples with these members: the token type; the
     token string; a 2-tuple (srow, scol) of ints specifying the row and
     column where the token begins in the source; a 2-tuple (erow, ecol) of
     ints specifying the row and column where the token ends in the source;
     and the line on which the token was found. The line passed is the
-    logical line; continuation lines are included. 
+    logical line; continuation lines are included.
     """
     lnum = parenlev = continued = 0
     namechars, numchars = string.ascii_letters + '_', '0123456789'
             user_pass, host = host.split('@', 1)
             if ':' in user_pass:
                 user, password = user_pass.split(':', 1)
-                user_pass = base64.encodestring('%s:%s' % (unquote(user), 
+                user_pass = base64.encodestring('%s:%s' % (unquote(user),
                                                            unquote(password)))
                 req.add_header('Proxy-Authorization', 'Basic ' + user_pass)
         host = unquote(host)