Skip to content

Commit 353d349

Browse files
author
tim.peters
committed
Whitespace normalization.
git-svn-id: http://svn.python.org/projects/python/trunk@53601 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 2c8452d commit 353d349

21 files changed

+131
-131
lines changed

Lib/CGIHTTPServer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def run_cgi(self):
107107
"""Execute a CGI script."""
108108
path = self.path
109109
dir, rest = self.cgi_info
110-
110+
111111
i = path.find('/', len(dir) + 1)
112112
while i >= 0:
113113
nextdir = path[:i]

Lib/cookielib.py

+43-43
Original file line numberDiff line numberDiff line change
@@ -1318,26 +1318,26 @@ def add_cookie_header(self, request):
13181318
self._cookies_lock.acquire()
13191319
try:
13201320

1321-
self._policy._now = self._now = int(time.time())
1322-
1323-
cookies = self._cookies_for_request(request)
1324-
1325-
attrs = self._cookie_attrs(cookies)
1326-
if attrs:
1327-
if not request.has_header("Cookie"):
1328-
request.add_unredirected_header(
1329-
"Cookie", "; ".join(attrs))
1330-
1331-
# if necessary, advertise that we know RFC 2965
1332-
if (self._policy.rfc2965 and not self._policy.hide_cookie2 and
1333-
not request.has_header("Cookie2")):
1334-
for cookie in cookies:
1335-
if cookie.version != 1:
1336-
request.add_unredirected_header("Cookie2", '$Version="1"')
1337-
break
1338-
1321+
self._policy._now = self._now = int(time.time())
1322+
1323+
cookies = self._cookies_for_request(request)
1324+
1325+
attrs = self._cookie_attrs(cookies)
1326+
if attrs:
1327+
if not request.has_header("Cookie"):
1328+
request.add_unredirected_header(
1329+
"Cookie", "; ".join(attrs))
1330+
1331+
# if necessary, advertise that we know RFC 2965
1332+
if (self._policy.rfc2965 and not self._policy.hide_cookie2 and
1333+
not request.has_header("Cookie2")):
1334+
for cookie in cookies:
1335+
if cookie.version != 1:
1336+
request.add_unredirected_header("Cookie2", '$Version="1"')
1337+
break
1338+
13391339
finally:
1340-
self._cookies_lock.release()
1340+
self._cookies_lock.release()
13411341

13421342
self.clear_expired_cookies()
13431343

@@ -1609,7 +1609,7 @@ def set_cookie_if_ok(self, cookie, request):
16091609

16101610
if self._policy.set_ok(cookie, request):
16111611
self.set_cookie(cookie)
1612-
1612+
16131613

16141614
finally:
16151615
self._cookies_lock.release()
@@ -1632,14 +1632,14 @@ def extract_cookies(self, response, request):
16321632
_debug("extract_cookies: %s", response.info())
16331633
self._cookies_lock.acquire()
16341634
try:
1635-
self._policy._now = self._now = int(time.time())
1635+
self._policy._now = self._now = int(time.time())
16361636

1637-
for cookie in self.make_cookies(response, request):
1638-
if self._policy.set_ok(cookie, request):
1639-
_debug(" setting cookie: %s", cookie)
1640-
self.set_cookie(cookie)
1637+
for cookie in self.make_cookies(response, request):
1638+
if self._policy.set_ok(cookie, request):
1639+
_debug(" setting cookie: %s", cookie)
1640+
self.set_cookie(cookie)
16411641
finally:
1642-
self._cookies_lock.release()
1642+
self._cookies_lock.release()
16431643

16441644
def clear(self, domain=None, path=None, name=None):
16451645
"""Clear some cookies.
@@ -1677,11 +1677,11 @@ def clear_session_cookies(self):
16771677
"""
16781678
self._cookies_lock.acquire()
16791679
try:
1680-
for cookie in self:
1681-
if cookie.discard:
1682-
self.clear(cookie.domain, cookie.path, cookie.name)
1680+
for cookie in self:
1681+
if cookie.discard:
1682+
self.clear(cookie.domain, cookie.path, cookie.name)
16831683
finally:
1684-
self._cookies_lock.release()
1684+
self._cookies_lock.release()
16851685

16861686
def clear_expired_cookies(self):
16871687
"""Discard all expired cookies.
@@ -1695,12 +1695,12 @@ def clear_expired_cookies(self):
16951695
"""
16961696
self._cookies_lock.acquire()
16971697
try:
1698-
now = time.time()
1699-
for cookie in self:
1700-
if cookie.is_expired(now):
1701-
self.clear(cookie.domain, cookie.path, cookie.name)
1698+
now = time.time()
1699+
for cookie in self:
1700+
if cookie.is_expired(now):
1701+
self.clear(cookie.domain, cookie.path, cookie.name)
17021702
finally:
1703-
self._cookies_lock.release()
1703+
self._cookies_lock.release()
17041704

17051705
def __iter__(self):
17061706
return deepvalues(self._cookies)
@@ -1774,16 +1774,16 @@ def revert(self, filename=None,
17741774
self._cookies_lock.acquire()
17751775
try:
17761776

1777-
old_state = copy.deepcopy(self._cookies)
1778-
self._cookies = {}
1779-
try:
1780-
self.load(filename, ignore_discard, ignore_expires)
1781-
except (LoadError, IOError):
1782-
self._cookies = old_state
1783-
raise
1777+
old_state = copy.deepcopy(self._cookies)
1778+
self._cookies = {}
1779+
try:
1780+
self.load(filename, ignore_discard, ignore_expires)
1781+
except (LoadError, IOError):
1782+
self._cookies = old_state
1783+
raise
17841784

17851785
finally:
1786-
self._cookies_lock.release()
1786+
self._cookies_lock.release()
17871787

17881788
from _LWPCookieJar import LWPCookieJar, lwp_cookie_str
17891789
from _MozillaCookieJar import MozillaCookieJar

Lib/dumbdbm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,5 +246,5 @@ def open(file, flag=None, mode=0666):
246246
else:
247247
# Turn off any bits that are set in the umask
248248
mode = mode & (~um)
249-
249+
250250
return _Database(file, mode)

Lib/ftplib.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def ntransfercmd(self, cmd, rest=None):
332332
# 1xx or error messages for LIST), so we just discard
333333
# this response.
334334
if resp[0] == '2':
335-
resp = self.getresp()
335+
resp = self.getresp()
336336
if resp[0] != '1':
337337
raise error_reply, resp
338338
else:
@@ -342,7 +342,7 @@ def ntransfercmd(self, cmd, rest=None):
342342
resp = self.sendcmd(cmd)
343343
# See above.
344344
if resp[0] == '2':
345-
resp = self.getresp()
345+
resp = self.getresp()
346346
if resp[0] != '1':
347347
raise error_reply, resp
348348
conn, sockaddr = sock.accept()

Lib/httplib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ def _send_request(self, method, url, body, headers):
899899
except (AttributeError, OSError):
900900
# Don't send a length if this failed
901901
if self.debuglevel > 0: print "Cannot stat!!"
902-
902+
903903
if thelen is not None:
904904
self.putheader('Content-Length',thelen)
905905
for hdr, value in headers.iteritems():

Lib/idlelib/CodeContext.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def toggle_code_context_event(self, event=None):
7171
#
7272
# To avoid possible errors, all references to the inner workings
7373
# of Tk are executed inside try/except blocks.
74-
74+
7575
widgets_for_width_calc = self.editwin.text, self.editwin.text_frame
7676

7777
# calculate the required vertical padding
@@ -113,7 +113,7 @@ def toggle_code_context_event(self, event=None):
113113
# above it.
114114
self.label.pack(side="top", fill="x", expand=False,
115115
before=self.editwin.text_frame)
116-
116+
117117
else:
118118
self.label.destroy()
119119
self.label = None

Lib/lib-tk/tkSimpleDialog.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def __init__(self, parent, title = None):
5050
# If the master is not viewable, don't
5151
# make the child transient, or else it
5252
# would be opened withdrawn
53-
if parent.winfo_viewable():
53+
if parent.winfo_viewable():
5454
self.transient(parent)
55-
55+
5656
if title:
5757
self.title(title)
5858

Lib/mailbox.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def flush(self):
572572
# already have been generated (and presumably has been modified
573573
# by adding or deleting an item).
574574
assert self._toc is not None
575-
575+
576576
# Check length of self._file; if it's changed, some other process
577577
# has modified the mailbox since we scanned it.
578578
self._file.seek(0, 2)
@@ -581,7 +581,7 @@ def flush(self):
581581
raise ExternalClashError('Size of mailbox file changed '
582582
'(expected %i, found %i)' %
583583
(self._file_length, cur_len))
584-
584+
585585
new_file = _create_temporary(self._path)
586586
try:
587587
new_toc = {}
@@ -1222,7 +1222,7 @@ def _generate_toc(self):
12221222
self._next_key = len(self._toc)
12231223
self._file.seek(0, 2)
12241224
self._file_length = self._file.tell()
1225-
1225+
12261226
def _pre_mailbox_hook(self, f):
12271227
"""Called before writing the mailbox to file f."""
12281228
f.write('BABYL OPTIONS:%sVersion: 5%sLabels:%s%s\037' %

Lib/platform.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def _dist_try_harder(distname,version,id):
236236
'[^(]*(?:\((.+)\))?')
237237

238238
# See also http://www.novell.com/coolsolutions/feature/11251.html
239-
# and http://linuxmafia.com/faq/Admin/release-files.html
239+
# and http://linuxmafia.com/faq/Admin/release-files.html
240240
# and http://data.linux-ntfs.org/rpm/whichrpm
241241
# and http://www.die.net/doc/linux/man/man1/lsb_release.1.html
242242

@@ -245,7 +245,7 @@ def _dist_try_harder(distname,version,id):
245245
'gentoo', 'UnitedLinux')
246246

247247
def _parse_release_file(firstline):
248-
248+
249249
# Parse the first line
250250
m = _lsb_release_version.match(firstline)
251251
if m is not None:
@@ -268,7 +268,7 @@ def _parse_release_file(firstline):
268268
return '', version, id
269269

270270
def _test_parse_release_file():
271-
271+
272272
for input, output in (
273273
# Examples of release file contents:
274274
('SuSE Linux 9.3 (x86-64)', ('SuSE Linux ', '9.3', 'x86-64'))
@@ -324,7 +324,7 @@ def linux_distribution(distname='', version='', id='',
324324
break
325325
else:
326326
return _dist_try_harder(distname,version,id)
327-
327+
328328
# Read the first line
329329
f = open('/etc/'+file, 'r')
330330
firstline = f.readline()
@@ -340,7 +340,7 @@ def linux_distribution(distname='', version='', id='',
340340
return distname, version, id
341341

342342
# To maintain backwards compatibility:
343-
343+
344344
def dist(distname='',version='',id='',
345345

346346
supported_dists=_supported_dists):
@@ -1358,7 +1358,7 @@ def python_branch():
13581358
If not available, an empty string is returned.
13591359
13601360
"""
1361-
1361+
13621362
return _sys_version()[2]
13631363

13641364
def python_revision():

Lib/pty.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def fork():
123123
os.close(tmp_fd)
124124
else:
125125
os.close(slave_fd)
126-
126+
127127
# Parent and child process.
128128
return pid, master_fd
129129

Lib/subprocess.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ def _communicate(self, input):
11201120
# we can write up to PIPE_BUF bytes without risk
11211121
# blocking. POSIX defines PIPE_BUF >= 512
11221122
bytes_written = os.write(self.stdin.fileno(), buffer(input, input_offset, 512))
1123-
input_offset += bytes_written
1123+
input_offset += bytes_written
11241124
if input_offset >= len(input):
11251125
self.stdin.close()
11261126
write_set.remove(self.stdin)

Lib/test/test_cfgparser.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def keys(self):
1515
result = self.data.keys()
1616
result.sort()
1717
return result
18-
18+
1919
def values(self):
2020
result = self.items()
2121
return [i[1] for i in values]
@@ -446,12 +446,12 @@ def test_sorted(self):
446446
"o2=3\n"
447447
"o1=4\n"
448448
"[a]\n"
449-
"k=v\n")
449+
"k=v\n")
450450
output = StringIO.StringIO()
451451
self.cf.write(output)
452452
self.assertEquals(output.getvalue(),
453453
"[a]\n"
454-
"k = v\n\n"
454+
"k = v\n\n"
455455
"[b]\n"
456456
"o1 = 4\n"
457457
"o2 = 3\n"

Lib/test/test_dumbdbm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_dumbdbm_creation_mode(self):
4949
f.close()
5050
finally:
5151
os.umask(old_umask)
52-
52+
5353
expected_mode = 0635
5454
if os.name != 'posix':
5555
# Windows only supports setting the read-only attribute.
@@ -61,7 +61,7 @@ def test_dumbdbm_creation_mode(self):
6161
self.assertEqual(stat.S_IMODE(st.st_mode), expected_mode)
6262
st = os.stat(_fname + '.dir')
6363
self.assertEqual(stat.S_IMODE(st.st_mode), expected_mode)
64-
64+
6565
def test_close_twice(self):
6666
f = dumbdbm.open(_fname)
6767
f['a'] = 'b'

Lib/test/test_gzip.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_seek_whence(self):
138138
y = f.read(10)
139139
f.close()
140140
self.assertEquals(y, data1[20:30])
141-
141+
142142
def test_seek_write(self):
143143
# Try seek, write test
144144
f = gzip.GzipFile(self.filename, 'w')

Lib/test/test_mailbox.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -681,11 +681,11 @@ def dummy_factory (s):
681681
box = self._factory(self._path, factory=dummy_factory)
682682
folder = box.add_folder('folder1')
683683
self.assert_(folder._factory is dummy_factory)
684-
684+
685685
folder1_alias = box.get_folder('folder1')
686686
self.assert_(folder1_alias._factory is dummy_factory)
687687

688-
688+
689689

690690
class _TestMboxMMDF(TestMailbox):
691691

@@ -805,7 +805,7 @@ def test_get_folder(self):
805805
def dummy_factory (s):
806806
return None
807807
self._box = self._factory(self._path, dummy_factory)
808-
808+
809809
new_folder = self._box.add_folder('foo.bar')
810810
folder0 = self._box.get_folder('foo.bar')
811811
folder0.add(self._template % 'bar')
@@ -901,7 +901,7 @@ def test_pack(self):
901901
self.assert_(self._box.get_sequences() ==
902902
{'foo':[1, 2, 3, 4, 5],
903903
'unseen':[1], 'bar':[3], 'replied':[3]})
904-
904+
905905
def _get_lock_path(self):
906906
return os.path.join(self._path, '.mh_sequences.lock')
907907

Lib/test/test_old_mailbox.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def setUp(self):
116116

117117
def tearDown(self):
118118
os.unlink(self._path)
119-
119+
120120
def test_from_regex (self):
121121
# Testing new regex from bug #1633678
122122
f = open(self._path, 'w')

0 commit comments

Comments
 (0)