Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0eadaac

Browse files
committed
Whitespace normalization.
1 parent 0822ff7 commit 0eadaac

39 files changed

Lines changed: 127 additions & 144 deletions

Lib/DocXMLRPCServer.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class ServerHTMLDoc(pydoc.HTMLDoc):
2424
"""Class used to generate pydoc HTML document for a server"""
25-
25+
2626
def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
2727
"""Mark up some plain text, given a context of symbols to look for.
2828
Each context dictionary maps object names to anchor names."""
@@ -63,7 +63,7 @@ def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
6363
here = end
6464
results.append(escape(text[here:]))
6565
return ''.join(results)
66-
66+
6767
def docroutine(self, object, name=None, mod=None,
6868
funcs={}, classes={}, methods={}, cl=None):
6969
"""Produce HTML documentation for a function or method object."""
@@ -72,7 +72,7 @@ def docroutine(self, object, name=None, mod=None,
7272
note = ''
7373

7474
title = '<a name="%s"><strong>%s</strong></a>' % (anchor, name)
75-
75+
7676
if inspect.ismethod(object):
7777
args, varargs, varkw, defaults = inspect.getargspec(object.im_func)
7878
# exclude the argument bound to the instance, it will be
@@ -96,7 +96,7 @@ def docroutine(self, object, name=None, mod=None,
9696
docstring = object[1] or ""
9797
else:
9898
docstring = pydoc.getdoc(object)
99-
99+
100100
decl = title + argspec + (note and self.grey(
101101
'<font face="helvetica, arial">%s</font>' % note))
102102

@@ -112,10 +112,10 @@ def docserver(self, server_name, package_documentation, methods):
112112
for key, value in methods.items():
113113
fdict[key] = '#-' + key
114114
fdict[value] = fdict[key]
115-
116-
head = '<big><big><strong>%s</strong></big></big>' % server_name
115+
116+
head = '<big><big><strong>%s</strong></big></big>' % server_name
117117
result = self.heading(head, '#ffffff', '#7799ee')
118-
118+
119119
doc = self.markup(package_documentation, self.preformat, fdict)
120120
doc = doc and '<tt>%s</tt>' % doc
121121
result = result + '<p>%s</p>\n' % doc
@@ -136,7 +136,7 @@ class XMLRPCDocGenerator:
136136
This class is designed as mix-in and should not
137137
be constructed directly.
138138
"""
139-
139+
140140
def __init__(self):
141141
# setup variables used for HTML documentation
142142
self.server_name = 'XML-RPC Server Documentation'
@@ -170,7 +170,7 @@ def generate_html_documentation(self):
170170
argument string used in the documentation and the
171171
_methodHelp(method_name) method to provide the help text used
172172
in the documentation."""
173-
173+
174174
methods = {}
175175

176176
for method_name in self.system_listMethods():
@@ -208,7 +208,7 @@ def generate_html_documentation(self):
208208
self.server_documentation,
209209
methods
210210
)
211-
211+
212212
return documenter.page(self.server_title, documentation)
213213

214214
class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
@@ -227,7 +227,7 @@ def do_GET(self):
227227
Interpret all HTTP GET requests as requests for server
228228
documentation.
229229
"""
230-
230+
231231
response = self.server.generate_html_documentation()
232232
self.send_response(200)
233233
self.send_header("Content-type", "text/html")
@@ -251,7 +251,7 @@ def __init__(self, addr, requestHandler=DocXMLRPCRequestHandler,
251251
logRequests=1):
252252
SimpleXMLRPCServer.__init__(self, addr, requestHandler, logRequests)
253253
XMLRPCDocGenerator.__init__(self)
254-
254+
255255
class DocCGIXMLRPCRequestHandler( CGIXMLRPCRequestHandler,
256256
XMLRPCDocGenerator):
257257
"""Handler for XML-RPC data and documentation requests passed through
@@ -281,8 +281,8 @@ def deg_to_rad(deg):
281281
282282
Converts an angle in degrees to an angle in radians"""
283283
import math
284-
return deg * math.pi / 180
285-
284+
return deg * math.pi / 180
285+
286286
server = DocXMLRPCServer(("localhost", 8000))
287287

288288
server.set_server_title("Math Server")
@@ -299,4 +299,4 @@ def deg_to_rad(deg):
299299
server.register_function(deg_to_rad)
300300
server.register_introspection_functions()
301301

302-
server.serve_forever()
302+
server.serve_forever()

Lib/_strptime.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ def sorter(a, b):
374374

375375
def pattern(self, format):
376376
"""Return re pattern for the format string.
377-
377+
378378
Need to make sure that any characters that might be interpreted as
379379
regex syntax is escaped.
380-
380+
381381
"""
382382
processed_format = ''
383383
# The sub() call escapes all characters that might be misconstrued
@@ -528,4 +528,3 @@ def _insensitiveindex(lst, findme):
528528
return key
529529
else:
530530
raise ValueError("value not in list")
531-

Lib/bsddb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import sys
4444
del sys.modules[__name__]
4545
raise
46-
46+
4747
# bsddb3 calls it db, but provide _db for backwards compatibility
4848
db = _db = _bsddb
4949
__version__ = db.__version__

Lib/bsddb/dbobj.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,3 @@ def set_get_returns_none(self, *args, **kwargs):
192192
if db.version() >= (4,1):
193193
def set_encrypt(self, *args, **kwargs):
194194
return apply(self._cobj.set_encrypt, args, kwargs)
195-

Lib/bsddb/dbshelve.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,3 @@ def _extract(self, rec):
296296

297297

298298
#---------------------------------------------------------------------------
299-
300-
301-

Lib/csv/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
from csv import *
2-

Lib/csv/csv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __init__(self, f, fieldnames, restval="", extrasaction="raise",
116116
self.restval = restval # for writing short dicts
117117
if extrasaction.lower() not in ("raise", "ignore"):
118118
raise ValueError, \
119-
("extrasaction (%s) must be 'raise' or 'ignore'" %
119+
("extrasaction (%s) must be 'raise' or 'ignore'" %
120120
extrasaction)
121121
self.extrasaction = extrasaction
122122
self.writer = writer(f, dialect, *args)
@@ -126,7 +126,7 @@ def _dict_to_list(self, rowdict):
126126
for k in rowdict.keys():
127127
if k not in self.fieldnames:
128128
raise ValueError, "dict contains fields not in fieldnames"
129-
return [rowdict.get(key, self.restval) for key in self.fieldnames]
129+
return [rowdict.get(key, self.restval) for key in self.fieldnames]
130130

131131
def writerow(self, rowdict):
132132
return self.writer.writerow(self._dict_to_list(rowdict))

Lib/csv/util/sniffer.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def sniff(self, fileobj):
2626
"""
2727
Takes a file-like object and returns a dialect (or None)
2828
"""
29-
29+
3030
self.fileobj = fileobj
31-
31+
3232
data = fileobj.read(self.sample)
3333

3434
quotechar, delimiter, skipinitialspace = self._guessQuoteAndDelimiter(data)
@@ -51,11 +51,11 @@ class Dialect(csv.Dialect):
5151

5252
def hasHeaders(self):
5353
return self._hasHeaders(self.fileobj, self.dialect)
54-
54+
5555

5656
def register_dialect(self, name = 'sniffed'):
5757
csv.register_dialect(name, self.dialect)
58-
58+
5959

6060
def _guessQuoteAndDelimiter(self, data):
6161
"""
@@ -78,7 +78,7 @@ def _guessQuoteAndDelimiter(self, data):
7878
matches = regexp.findall(data)
7979
if matches:
8080
break
81-
81+
8282
if not matches:
8383
return ('', None, 0) # (quotechar, delimiter, skipinitialspace)
8484

@@ -117,7 +117,7 @@ def _guessQuoteAndDelimiter(self, data):
117117
# there is *no* delimiter, it's a single column of quoted data
118118
delim = ''
119119
skipinitialspace = 0
120-
120+
121121
return (quotechar, delim, skipinitialspace)
122122

123123

@@ -132,14 +132,14 @@ def _guessDelimiter(self, data):
132132
e.g. "x occurred 5 times in 10 rows, 6 times in 1000 rows,
133133
7 times in 2 rows"
134134
3) use the mode of the meta-frequency to determine the /expected/
135-
frequency for that character
136-
4) find out how often the character actually meets that goal
137-
5) the character that best meets its goal is the delimiter
135+
frequency for that character
136+
4) find out how often the character actually meets that goal
137+
5) the character that best meets its goal is the delimiter
138138
For performance reasons, the data is evaluated in chunks, so it can
139139
try and evaluate the smallest portion of the data possible, evaluating
140-
additional chunks as necessary.
140+
additional chunks as necessary.
141141
"""
142-
142+
143143
data = filter(None, data.split('\n'))
144144

145145
ascii = [chr(c) for c in range(127)] # 7-bit ASCII
@@ -218,7 +218,7 @@ def _hasHeaders(self, fileobj, dialect):
218218
# be a string in which case the length of the string is the determining factor: if
219219
# all of the rows except for the first are the same length, it's a header.
220220
# Finally, a 'vote' is taken at the end for each column, adding or subtracting from
221-
# the likelihood of the first row being a header.
221+
# the likelihood of the first row being a header.
222222

223223
def seval(item):
224224
"""
@@ -227,7 +227,7 @@ def seval(item):
227227
return eval(item.replace('(', '').replace(')', ''))
228228

229229
fileobj.seek(0) # rewind the fileobj - this might not work for some file-like objects...
230-
230+
231231
reader = csv.reader(fileobj,
232232
delimiter = dialect.delimiter,
233233
quotechar = dialect.quotechar,
@@ -284,6 +284,3 @@ def seval(item):
284284
hasHeader -= 1
285285

286286
return hasHeader > 0
287-
288-
289-

Lib/encodings/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,3 @@ def search_function(encoding):
120120

121121
# Register the search_function in the Python codec registry
122122
codecs.register(search_function)
123-

Lib/encodings/idna.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def nameprep(label):
1919
continue
2020
newlabel.append(stringprep.map_table_b2(c))
2121
label = u"".join(newlabel)
22-
22+
2323
# Normalize
2424
label = unicodedata.normalize("NFKC", label)
25-
25+
2626
# Prohibit
2727
for c in label:
2828
if stringprep.in_table_c12(c) or \
@@ -139,7 +139,7 @@ def ToUnicode(label):
139139

140140
# Step 8: return the result of step 5
141141
return result
142-
142+
143143
### Codec APIs
144144

145145
class Codec(codecs.Codec):
@@ -156,7 +156,7 @@ def encode(self,input,errors='strict'):
156156
return ".".join(result), len(input)
157157

158158
def decode(self,input,errors='strict'):
159-
159+
160160
if errors != 'strict':
161161
raise UnicodeError, "Unsupported error handling "+errors
162162

0 commit comments

Comments
 (0)