From 04ecd5542849191457ccfc3e42a39452db47825a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 21 Apr 2015 15:26:47 +0200 Subject: Strip trailing spaces --- paste/debug/doctest_webapp.py | 8 ++++---- paste/debug/fsdiff.py | 2 +- paste/debug/prints.py | 2 +- paste/debug/profile.py | 8 ++++---- paste/debug/testserver.py | 6 +++--- paste/debug/watchthreads.py | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'paste/debug') diff --git a/paste/debug/doctest_webapp.py b/paste/debug/doctest_webapp.py index f399ac3..4b9f95a 100755 --- a/paste/debug/doctest_webapp.py +++ b/paste/debug/doctest_webapp.py @@ -214,7 +214,7 @@ def show_file(path, version, description=None, data=None): data = f.read() f.close() if ext == '.py': - html = ('
%s
' + html = ('
%s
' % PySourceColor.str2html(data, PySourceColor.dark)) else: html = '
%s
' % cgi.escape(data, 1) @@ -241,7 +241,7 @@ def write_data(path, data): f = open(path, 'wb') f.write(data) f.close() - + def change_file(path, changes): f = open(os.path.abspath(path), 'rb') @@ -282,7 +282,7 @@ class LongFormDocTestParser(doctest.DocTestParser): (?![ ]*>>>) # Not a line starting with PS1 .*$\n? # But any other line )*)) - | + | (?: # This is for longer commands that are prefixed with a reST # comment like '.. run:' (two colons makes that a directive). # These commands cannot have any output. @@ -331,7 +331,7 @@ class LongFormDocTestParser(doctest.DocTestParser): # Get the example's indentation level. runner = m.group('run') or '' indent = len(m.group('%sindent' % runner)) - + # Divide source into lines; check that they're properly # indented; and then strip their indentation & prompts. source_lines = m.group('%ssource' % runner).split('\n') diff --git a/paste/debug/fsdiff.py b/paste/debug/fsdiff.py index 156a2e4..b91eb49 100644 --- a/paste/debug/fsdiff.py +++ b/paste/debug/fsdiff.py @@ -298,7 +298,7 @@ class Dir(File): "Directory %r doesn't have content" % self) bytes = property(bytes__get) - + def _space_prefix(pref, full, sep=None, indent=None, include_sep=True): """ diff --git a/paste/debug/prints.py b/paste/debug/prints.py index 6cc3f7d..b660bfa 100644 --- a/paste/debug/prints.py +++ b/paste/debug/prints.py @@ -132,7 +132,7 @@ class PrintDebugMiddleware(object): _body_re = re.compile(r']*>', re.I) _explicit_re = re.compile(r']*id="paste-debug-prints".*?>', re.I+re.S) - + def add_log(self, html, log): if not log: return html diff --git a/paste/debug/profile.py b/paste/debug/profile.py index 036c805..470a54a 100644 --- a/paste/debug/profile.py +++ b/paste/debug/profile.py @@ -100,7 +100,7 @@ def profile_decorator(**options): """ Profile a single function call. - + Used around a function, like:: @profile_decorator(options...) @@ -203,14 +203,14 @@ class DecoratedProfile(object): # We captured an exception earlier, now we re-raise it six.reraise(exc_info[0], exc_info[1], exc_info[2]) return result - + def format_function(self, func, *args, **kw): args = map(repr, args) args.extend( ['%s=%r' % (k, v) for k, v in kw.items()]) return '%s(%s)' % (func.__name__, ', '.join(args)) - - + + def make_profile_middleware( app, global_conf, log_filename='profile.log.tmp', diff --git a/paste/debug/testserver.py b/paste/debug/testserver.py index 4817161..8044c7c 100755 --- a/paste/debug/testserver.py +++ b/paste/debug/testserver.py @@ -28,7 +28,7 @@ class WSGIRegressionServer(WSGIServer): self.pending = [] self.timeout = self.defaulttimeout # this is a local connection, be quick - self.socket.settimeout(2) + self.socket.settimeout(2) def serve_forever(self): from threading import Thread thread = Thread(target=self.serve_pending) @@ -75,13 +75,13 @@ if __name__ == '__main__': def fetch(path): # tell the server to humor exactly one more request server.accept(1) - # not needed; but this is what you do if the server + # not needed; but this is what you do if the server # may not respond in a resonable time period import socket socket.setdefaulttimeout(5) # build a uri, fetch and return return urlopen(baseuri + path).read() - + assert "PATH_INFO: /foo" in fetch("/foo") assert "PATH_INFO: /womble" in fetch("/womble") diff --git a/paste/debug/watchthreads.py b/paste/debug/watchthreads.py index c877942..b06ccea 100644 --- a/paste/debug/watchthreads.py +++ b/paste/debug/watchthreads.py @@ -123,7 +123,7 @@ page_template = HTMLTemplate(''' } return false ">▸ Show environ - +