Skip to content

Commit 2c60f7a

Browse files
committed
Whitespace normalization.
1 parent c0c12b5 commit 2c60f7a

11 files changed

Lines changed: 98 additions & 98 deletions

β€ŽLib/SimpleXMLRPCServer.pyβ€Ž

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def _listMethods(self):
3232
['string.' + method for method in list_public_methods(self.string)]
3333
def pow(self, x, y): return pow(x, y)
3434
def add(self, x, y) : return x + y
35-
35+
3636
server = SimpleXMLRPCServer(("localhost", 8000))
3737
server.register_introspection_functions()
3838
server.register_instance(MyFuncs())
@@ -137,7 +137,7 @@ def remove_duplicates(lst):
137137
Returns a copy of a list without duplicates. Every list
138138
item must be hashable and the order of the items in the
139139
resulting list is not defined.
140-
"""
140+
"""
141141
u = {}
142142
for x in lst:
143143
u[x] = 1
@@ -151,7 +151,7 @@ class SimpleXMLRPCDispatcher:
151151
and then to dispatch them. There should never be any
152152
reason to instantiate this class directly.
153153
"""
154-
154+
155155
def __init__(self):
156156
self.funcs = {}
157157
self.instance = None
@@ -195,7 +195,7 @@ def register_introspection_functions(self):
195195
196196
see http://xmlrpc.usefulinc.com/doc/reserved.html
197197
"""
198-
198+
199199
self.funcs.update({'system.listMethods' : self.system_listMethods,
200200
'system.methodSignature' : self.system_methodSignature,
201201
'system.methodHelp' : self.system_methodHelp})
@@ -205,28 +205,28 @@ def register_multicall_functions(self):
205205
namespace.
206206
207207
see http://www.xmlrpc.com/discuss/msgReader$1208"""
208-
208+
209209
self.funcs.update({'system.multicall' : self.system_multicall})
210-
210+
211211
def _marshaled_dispatch(self, data, dispatch_method = None):
212212
"""Dispatches an XML-RPC method from marshalled (XML) data.
213-
213+
214214
XML-RPC methods are dispatched from the marshalled (XML) data
215215
using the _dispatch method and the result is returned as
216216
marshalled data. For backwards compatibility, a dispatch
217-
function can be provided as an argument (see comment in
217+
function can be provided as an argument (see comment in
218218
SimpleXMLRPCRequestHandler.do_POST) but overriding the
219219
existing method through subclassing is the prefered means
220220
of changing method dispatch behavior.
221221
"""
222-
222+
223223
params, method = xmlrpclib.loads(data)
224224

225225
# generate response
226226
try:
227227
if dispatch_method is not None:
228228
response = dispatch_method(method, params)
229-
else:
229+
else:
230230
response = self._dispatch(method, params)
231231
# wrap response in a singleton tuple
232232
response = (response,)
@@ -245,7 +245,7 @@ def system_listMethods(self):
245245
"""system.listMethods() => ['add', 'subtract', 'multiple']
246246
247247
Returns a list of the methods supported by the server."""
248-
248+
249249
methods = self.funcs.keys()
250250
if self.instance is not None:
251251
# Instance can implement _listMethod to return a list of
@@ -263,7 +263,7 @@ def system_listMethods(self):
263263
)
264264
methods.sort()
265265
return methods
266-
266+
267267
def system_methodSignature(self, method_name):
268268
"""system.methodSignature('add') => [double, int, int]
269269
@@ -274,14 +274,14 @@ def system_methodSignature(self, method_name):
274274
This server does NOT support system.methodSignature."""
275275

276276
# See http://xmlrpc.usefulinc.com/doc/sysmethodsig.html
277-
277+
278278
return 'signatures not supported'
279279

280280
def system_methodHelp(self, method_name):
281281
"""system.methodHelp('add') => "Adds two integers together"
282282
283283
Returns a string containing documentation for the specified method."""
284-
284+
285285
method = None
286286
if self.funcs.has_key(method_name):
287287
method = self.funcs[method_name]
@@ -314,9 +314,9 @@ def system_multicall(self, call_list):
314314
Allows the caller to package multiple XML-RPC calls into a single
315315
request.
316316
317-
See http://www.xmlrpc.com/discuss/msgReader$1208
317+
See http://www.xmlrpc.com/discuss/msgReader$1208
318318
"""
319-
319+
320320
results = []
321321
for call in call_list:
322322
method_name = call['methodName']
@@ -337,7 +337,7 @@ def system_multicall(self, call_list):
337337
'faultString' : "%s:%s" % (sys.exc_type, sys.exc_value)}
338338
)
339339
return results
340-
340+
341341
def _dispatch(self, method, params):
342342
"""Dispatches the XML-RPC method.
343343
@@ -382,7 +382,7 @@ def _dispatch(self, method, params):
382382
return func(*params)
383383
else:
384384
raise Exception('method "%s" is not supported' % method)
385-
385+
386386
class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
387387
"""Simple XML-RPC request handler class.
388388
@@ -396,7 +396,7 @@ def do_POST(self):
396396
Attempts to interpret all HTTP POST requests as XML-RPC calls,
397397
which are forwarded to the server's _dispatch method for handling.
398398
"""
399-
399+
400400
try:
401401
# get arguments
402402
data = self.rfile.read(int(self.headers["content-length"]))
@@ -423,14 +423,14 @@ def do_POST(self):
423423
# shut down the connection
424424
self.wfile.flush()
425425
self.connection.shutdown(1)
426-
426+
427427
def log_request(self, code='-', size='-'):
428428
"""Selectively log an accepted request."""
429429

430430
if self.server.logRequests:
431431
BaseHTTPServer.BaseHTTPRequestHandler.log_request(self, code, size)
432432

433-
class SimpleXMLRPCServer(SocketServer.TCPServer,
433+
class SimpleXMLRPCServer(SocketServer.TCPServer,
434434
SimpleXMLRPCDispatcher):
435435
"""Simple XML-RPC server.
436436
@@ -444,21 +444,21 @@ class SimpleXMLRPCServer(SocketServer.TCPServer,
444444
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler,
445445
logRequests=1):
446446
self.logRequests = logRequests
447-
447+
448448
SimpleXMLRPCDispatcher.__init__(self)
449449
SocketServer.TCPServer.__init__(self, addr, requestHandler)
450-
450+
451451
class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher):
452452
"""Simple handler for XML-RPC data passed through CGI."""
453-
453+
454454
def __init__(self):
455455
SimpleXMLRPCDispatcher.__init__(self)
456456

457457
def handle_xmlrpc(self, request_text):
458458
"""Handle a single XML-RPC request"""
459-
459+
460460
response = self._marshaled_dispatch(request_text)
461-
461+
462462
print 'Content-Type: text/xml'
463463
print 'Content-Length: %d' % len(response)
464464
print
@@ -474,37 +474,37 @@ def handle_get(self):
474474
code = 400
475475
message, explain = \
476476
BaseHTTPServer.BaseHTTPRequestHandler.responses[code]
477-
477+
478478
response = BaseHTTPServer.DEFAULT_ERROR_MESSAGE % \
479479
{
480-
'code' : code,
481-
'message' : message,
480+
'code' : code,
481+
'message' : message,
482482
'explain' : explain
483483
}
484484
print 'Status: %d %s' % (code, message)
485485
print 'Content-Type: text/html'
486486
print 'Content-Length: %d' % len(response)
487487
print
488488
print response
489-
489+
490490
def handle_request(self, request_text = None):
491491
"""Handle a single XML-RPC request passed through a CGI post method.
492-
492+
493493
If no XML data is given then it is read from stdin. The resulting
494494
XML-RPC response is printed to stdout along with the correct HTTP
495495
headers.
496496
"""
497-
497+
498498
if request_text is None and \
499499
os.environ.get('REQUEST_METHOD', None) == 'GET':
500500
self.handle_get()
501501
else:
502502
# POST data is normally available through stdin
503503
if request_text is None:
504-
request_text = sys.stdin.read()
504+
request_text = sys.stdin.read()
505505

506506
self.handle_xmlrpc(request_text)
507-
507+
508508
if __name__ == '__main__':
509509
server = SimpleXMLRPCServer(("localhost", 8000))
510510
server.register_function(pow)

β€ŽLib/_strptime.pyβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,12 @@ def strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
499499
#populous then just inline calculations. Also might be able to use
500500
#``datetime`` and the methods it provides.
501501
if julian == -1:
502-
julian = julianday(year, month, day)
502+
julian = julianday(year, month, day)
503503
else: # Assuming that if they bothered to include Julian day it will
504504
#be accurate
505-
year, month, day = gregorian(julian, year)
505+
year, month, day = gregorian(julian, year)
506506
if weekday == -1:
507-
weekday = dayofweek(year, month, day)
507+
weekday = dayofweek(year, month, day)
508508
return time.struct_time((year, month, day,
509509
hour, minute, second,
510510
weekday, julian, tz))

β€ŽLib/dummy_thread.pyβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
not need to be rewritten for when the thread module is not present.
55
66
Suggested usage is::
7-
7+
88
try:
99
import thread
1010
except ImportError:
@@ -67,7 +67,7 @@ def allocate_lock():
6767

6868
class LockType(object):
6969
"""Class implementing dummy implementation of thread.LockType.
70-
70+
7171
Compatibility is maintained by maintaining self.locked_status
7272
which is a boolean that stores the state of the lock. Pickling of
7373
the lock, though, should not be done since if the thread module is
@@ -78,7 +78,7 @@ class LockType(object):
7878

7979
def __init__(self):
8080
self.locked_status = False
81-
81+
8282
def acquire(self, waitflag=None):
8383
"""Dummy implementation of acquire().
8484
@@ -92,7 +92,7 @@ def acquire(self, waitflag=None):
9292
"""
9393
if waitflag is None:
9494
self.locked_status = True
95-
return None
95+
return None
9696
elif not waitflag:
9797
if not self.locked_status:
9898
self.locked_status = True
@@ -101,7 +101,7 @@ def acquire(self, waitflag=None):
101101
return False
102102
else:
103103
self.locked_status = True
104-
return True
104+
return True
105105

106106
def release(self):
107107
"""Release the dummy lock."""

β€ŽLib/macpath.pyβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ def dirname(s): return split(s)[0]
8585
def basename(s): return split(s)[1]
8686

8787
def ismount(s):
88-
if not isabs(s):
89-
return False
90-
components = split(s)
91-
return len(components) == 2 and components[1] == ''
88+
if not isabs(s):
89+
return False
90+
components = split(s)
91+
return len(components) == 2 and components[1] == ''
9292

9393
def isdir(s):
9494
"""Return true if the pathname refers to an existing directory."""

β€ŽLib/modulefinder.pyβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,9 @@ def replace_paths_in_code(self, co):
514514
if isinstance(consts[i], type(co)):
515515
consts[i] = self.replace_paths_in_code(consts[i])
516516

517-
return new.code(co.co_argcount, co.co_nlocals, co.co_stacksize,
518-
co.co_flags, co.co_code, tuple(consts), co.co_names,
519-
co.co_varnames, new_filename, co.co_name,
517+
return new.code(co.co_argcount, co.co_nlocals, co.co_stacksize,
518+
co.co_flags, co.co_code, tuple(consts), co.co_names,
519+
co.co_varnames, new_filename, co.co_name,
520520
co.co_firstlineno, co.co_lnotab,
521521
co.co_freevars, co.co_cellvars)
522522

β€ŽLib/os.pyβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@ def copy(self):
415415
environ = _Environ(environ)
416416

417417
def getenv(key, default=None):
418-
"""Get an environment variable, return None if it doesn't exist.
419-
The optional second argument can specify an alternate default."""
420-
return environ.get(key, default)
418+
"""Get an environment variable, return None if it doesn't exist.
419+
The optional second argument can specify an alternate default."""
420+
return environ.get(key, default)
421421
__all__.append("getenv")
422422

423423
def _exists(name):

β€ŽLib/pickletools.pyβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,10 +1859,10 @@ def dis(pickle, out=None, indentlevel=4):
18591859

18601860
markmsg = None
18611861
if markstack and markobject in opcode.stack_before:
1862-
assert markobject not in opcode.stack_after
1863-
markpos = markstack.pop()
1864-
if markpos is not None:
1865-
markmsg = "(MARK at %d)" % markpos
1862+
assert markobject not in opcode.stack_after
1863+
markpos = markstack.pop()
1864+
if markpos is not None:
1865+
markmsg = "(MARK at %d)" % markpos
18661866

18671867
if arg is not None or markmsg:
18681868
# make a mild effort to align arguments

β€ŽLib/pty.pyβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def slave_open(tty_name):
9292
except ImportError:
9393
return result
9494
try:
95-
ioctl(result, I_PUSH, "ptem")
96-
ioctl(result, I_PUSH, "ldterm")
95+
ioctl(result, I_PUSH, "ptem")
96+
ioctl(result, I_PUSH, "ldterm")
9797
except IOError:
9898
pass
9999
return result

0 commit comments

Comments
 (0)