Skip to content

Commit 88869f9

Browse files
committed
Whitespace normalization.
1 parent 752d3f5 commit 88869f9

16 files changed

Lines changed: 1233 additions & 1235 deletions

‎Lib/ConfigParser.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@
7373
1, only)
7474
7575
remove_section(section)
76-
remove the given file section and all its options
76+
remove the given file section and all its options
7777
7878
remove_option(section, option)
79-
remove the given option from the given section
79+
remove the given option from the given section
8080
8181
set(section, option, value)
8282
set the given option
8383
8484
write(fp)
85-
write the configuration state in .ini format
85+
write the configuration state in .ini format
8686
"""
8787

8888
import sys
@@ -94,7 +94,7 @@
9494
MAX_INTERPOLATION_DEPTH = 10
9595

9696

97-
97+
9898
# exception classes
9999
class Error(Exception):
100100
def __init__(self, msg=''):
@@ -166,7 +166,7 @@ def __init__(self, filename, lineno, line):
166166
self.line = line
167167

168168

169-
169+
170170
class ConfigParser:
171171
def __init__(self, defaults=None):
172172
self.__sections = {}
@@ -217,7 +217,7 @@ def has_option(self, section, option):
217217

218218
def read(self, filenames):
219219
"""Read and parse a filename or a list of filenames.
220-
220+
221221
Files that cannot be opened are silently ignored; this is
222222
designed so that you can specify a list of potential
223223
configuration file locations (e.g. current directory, user's
@@ -285,7 +285,7 @@ def get(self, section, option, raw=0, vars=None):
285285

286286
# do the string interpolation
287287
value = rawval # Make it a pretty variable name
288-
depth = 0
288+
depth = 0
289289
while depth < 10: # Loop through this until it's done
290290
depth = depth + 1
291291
if string.find(value, "%(") >= 0:
@@ -298,7 +298,7 @@ def get(self, section, option, raw=0, vars=None):
298298
if value.find("%(") >= 0:
299299
raise InterpolationDepthError(option, section, rawval)
300300
return value
301-
301+
302302
def __get(self, section, conv, option):
303303
return conv(self.get(section, option))
304304

‎Lib/Cookie.py‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33

44
####
55
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
6-
#
6+
#
77
# All Rights Reserved
8-
#
8+
#
99
# Permission to use, copy, modify, and distribute this software
1010
# and its documentation for any purpose and without fee is hereby
1111
# granted, provided that the above copyright notice appear in all
1212
# copies and that both that copyright notice and this permission
1313
# notice appear in supporting documentation, and that the name of
1414
# Timothy O'Malley not be used in advertising or publicity
1515
# pertaining to distribution of the software without specific, written
16-
# prior permission.
17-
#
16+
# prior permission.
17+
#
1818
# Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
1919
# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2020
# AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR
2121
# ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
2222
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
2323
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
2424
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25-
# PERFORMANCE OF THIS SOFTWARE.
25+
# PERFORMANCE OF THIS SOFTWARE.
2626
#
2727
####
28-
#
29-
# Id: Cookie.py,v 2.29 2000/08/23 05:28:49 timo Exp
28+
#
29+
# Id: Cookie.py,v 2.29 2000/08/23 05:28:49 timo Exp
3030
# by Timothy O'Malley <timo@alum.mit.edu>
3131
#
3232
# Cookie.py is a Python module for the handling of HTTP
@@ -116,7 +116,7 @@
116116
Set-Cookie: oreo="doublestuff"; Path=/;
117117
118118
Each dictionary element has a 'value' attribute, which gives you
119-
back the value associated with the key.
119+
back the value associated with the key.
120120
121121
>>> C = Cookie.SmartCookie()
122122
>>> C["twix"] = "none for you"
@@ -148,7 +148,7 @@
148148
Set-Cookie: number=7;
149149
Set-Cookie: string=seven;
150150
151-
151+
152152
SerialCookie
153153
154154
The SerialCookie expects that all values should be serialized using
@@ -214,7 +214,7 @@
214214

215215
#
216216
# Import our required modules
217-
#
217+
#
218218
import string, sys
219219
from UserDict import UserDict
220220

@@ -242,7 +242,7 @@ class CookieError(Exception):
242242
# into a 4 character sequence: a forward-slash followed by the
243243
# three-digit octal equivalent of the character. Any '\' or '"' is
244244
# quoted with a preceeding '\' slash.
245-
#
245+
#
246246
# These are taken from RFC2068 and RFC2109.
247247
# _LegalChars is the list of chars which don't require "'s
248248
# _Translator hash-table for fast quoting
@@ -319,7 +319,7 @@ def _quote(str, LegalChars=_LegalChars,
319319
if "" == translate(str, idmap, LegalChars):
320320
return str
321321
else:
322-
return '"' + join( map(_Translator.get, str, str), "" ) + '"'
322+
return '"' + join( map(_Translator.get, str, str), "" ) + '"'
323323
# end _quote
324324

325325

@@ -370,7 +370,7 @@ def _unquote(str, join=string.join, atoi=string.atoi):
370370

371371
# The _getdate() routine is used to set the expiration time in
372372
# the cookie's HTTP header. By default, _getdate() returns the
373-
# current time in the appropriate "expires" format for a
373+
# current time in the appropriate "expires" format for a
374374
# Set-Cookie header. The one optional argument is an offset from
375375
# now, in seconds. For example, an offset of -3600 means "one hour ago".
376376
# The offset may be a floating point number.
@@ -405,7 +405,7 @@ class Morsel(UserDict):
405405
# RFC 2109 lists these attributes as reserved:
406406
# path comment domain
407407
# max-age secure version
408-
#
408+
#
409409
# For historical reasons, these attributes are also reserved:
410410
# expires
411411
#

‎Lib/calendar.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def month(theyear, themonth, w=0, l=0):
131131
"""Return a month's calendar string (multi-line)."""
132132
w = max(2, w)
133133
l = max(1, l)
134-
s = (_center(month_name[themonth] + ' ' + `theyear`,
134+
s = (_center(month_name[themonth] + ' ' + `theyear`,
135135
7 * (w + 1) - 1).rstrip() +
136136
'\n' * l + weekheader(w).rstrip() + '\n' * l)
137137
for aweek in monthcalendar(theyear, themonth):
@@ -167,7 +167,7 @@ def calendar(year, w=0, l=0, c=_spacing):
167167
for q in range(January, January+12, 3):
168168
s = (s + '\n' * l +
169169
format3cstring(month_name[q], month_name[q+1], month_name[q+2],
170-
colwidth, c).rstrip() +
170+
colwidth, c).rstrip() +
171171
'\n' * l + header + '\n' * l)
172172
data = []
173173
height = 0
@@ -183,7 +183,7 @@ def calendar(year, w=0, l=0, c=_spacing):
183183
weeks.append('')
184184
else:
185185
weeks.append(week(cal[i], w))
186-
s = s + format3cstring(weeks[0], weeks[1], weeks[2],
186+
s = s + format3cstring(weeks[0], weeks[1], weeks[2],
187187
colwidth, c).rstrip() + '\n' * l
188188
return s[:-l] + '\n'
189189

‎Lib/cgi.py‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
# History
1313
# -------
14-
#
14+
#
1515
# Michael McLay started this module. Steve Majewski changed the
1616
# interface to SvFormContentDict and FormContentDict. The multipart
1717
# parsing was inspired by code submitted by Andreas Paepcke. Guido van
1818
# Rossum rewrote, reformatted and documented the module and is currently
1919
# responsible for its maintenance.
20-
#
20+
#
2121

2222
__version__ = "2.5"
2323

@@ -104,8 +104,8 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
104104
environ : environment dictionary; default: os.environ
105105
106106
keep_blank_values: flag indicating whether blank values in
107-
URL encoded forms should be treated as blank strings.
108-
A true value indicates that blanks should be retained as
107+
URL encoded forms should be treated as blank strings.
108+
A true value indicates that blanks should be retained as
109109
blank strings. The default false value indicates that
110110
blank values are to be ignored and treated as if they were
111111
not included.
@@ -129,10 +129,10 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
129129
qs = fp.read(clength)
130130
else:
131131
qs = '' # Unknown content-type
132-
if environ.has_key('QUERY_STRING'):
132+
if environ.has_key('QUERY_STRING'):
133133
if qs: qs = qs + '&'
134134
qs = qs + environ['QUERY_STRING']
135-
elif sys.argv[1:]:
135+
elif sys.argv[1:]:
136136
if qs: qs = qs + '&'
137137
qs = qs + sys.argv[1]
138138
environ['QUERY_STRING'] = qs # XXX Shouldn't, really
@@ -155,8 +155,8 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
155155
qs: URL-encoded query string to be parsed
156156
157157
keep_blank_values: flag indicating whether blank values in
158-
URL encoded queries should be treated as blank strings.
159-
A true value indicates that blanks should be retained as
158+
URL encoded queries should be treated as blank strings.
159+
A true value indicates that blanks should be retained as
160160
blank strings. The default false value indicates that
161161
blank values are to be ignored and treated as if they were
162162
not included.
@@ -188,7 +188,7 @@ def parse_qsl(qs, keep_blank_values=0, strict_parsing=0):
188188
189189
strict_parsing: flag indicating what to do with parsing errors. If
190190
false (the default), errors are silently ignored. If true,
191-
errors raise a ValueError exception.
191+
errors raise a ValueError exception.
192192
193193
Returns a list, as G-d intended.
194194
"""
@@ -215,17 +215,17 @@ def parse_multipart(fp, pdict):
215215
fp : input file
216216
pdict: dictionary containing other parameters of conten-type header
217217
218-
Returns a dictionary just like parse_qs(): keys are the field names, each
219-
value is a list of values for that field. This is easy to use but not
220-
much good if you are expecting megabytes to be uploaded -- in that case,
221-
use the FieldStorage class instead which is much more flexible. Note
222-
that content-type is the raw, unparsed contents of the content-type
218+
Returns a dictionary just like parse_qs(): keys are the field names, each
219+
value is a list of values for that field. This is easy to use but not
220+
much good if you are expecting megabytes to be uploaded -- in that case,
221+
use the FieldStorage class instead which is much more flexible. Note
222+
that content-type is the raw, unparsed contents of the content-type
223223
header.
224-
225-
XXX This does not parse nested multipart parts -- use FieldStorage for
224+
225+
XXX This does not parse nested multipart parts -- use FieldStorage for
226226
that.
227-
228-
XXX This should really be subsumed by FieldStorage altogether -- no
227+
228+
XXX This should really be subsumed by FieldStorage altogether -- no
229229
point in having two implementations of the same parsing algorithm.
230230
231231
"""
@@ -409,8 +409,8 @@ def __init__(self, fp=None, headers=None, outerboundary="",
409409
environ : environment dictionary; default: os.environ
410410
411411
keep_blank_values: flag indicating whether blank values in
412-
URL encoded forms should be treated as blank strings.
413-
A true value indicates that blanks should be retained as
412+
URL encoded forms should be treated as blank strings.
413+
A true value indicates that blanks should be retained as
414414
blank strings. The default false value indicates that
415415
blank values are to be ignored and treated as if they were
416416
not included.
@@ -707,7 +707,7 @@ def make_file(self, binary=None):
707707
"""
708708
import tempfile
709709
return tempfile.TemporaryFile("w+b")
710-
710+
711711

712712

713713
# Backwards Compatibility Classes
@@ -744,8 +744,8 @@ class SvFormContentDict(FormContentDict):
744744
745745
"""
746746
def __getitem__(self, key):
747-
if len(self.dict[key]) > 1:
748-
raise IndexError, 'expecting a single value'
747+
if len(self.dict[key]) > 1:
748+
raise IndexError, 'expecting a single value'
749749
return self.dict[key][0]
750750
def getlist(self, key):
751751
return self.dict[key]
@@ -766,7 +766,7 @@ def items(self):
766766

767767

768768
class InterpFormContentDict(SvFormContentDict):
769-
"""This class is present for backwards compatibility only."""
769+
"""This class is present for backwards compatibility only."""
770770
def __getitem__(self, key):
771771
v = SvFormContentDict.__getitem__(self, key)
772772
if v[0] in string.digits + '+-.':
@@ -794,7 +794,7 @@ def items(self):
794794

795795

796796
class FormContent(FormContentDict):
797-
"""This class is present for backwards compatibility only."""
797+
"""This class is present for backwards compatibility only."""
798798
def values(self, key):
799799
if self.dict.has_key(key) :return self.dict[key]
800800
else: return None
@@ -882,7 +882,7 @@ def print_environ(environ=os.environ):
882882
print "<DL>"
883883
for key in keys:
884884
print "<DT>", escape(key), "<DD>", escape(environ[key])
885-
print "</DL>"
885+
print "</DL>"
886886
print
887887

888888
def print_form(form):
@@ -982,5 +982,5 @@ def escape(s, quote=None):
982982
# ===============
983983

984984
# Call test() when this file is run as a script (not imported as a module)
985-
if __name__ == '__main__':
985+
if __name__ == '__main__':
986986
test()

0 commit comments

Comments
 (0)