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/__init__.py | 2 +- paste/auth/basic.py | 4 +- paste/auth/cookie.py | 2 +- paste/auth/form.py | 2 +- paste/auth/grantip.py | 12 +++--- paste/auth/open_id.py | 10 ++--- paste/cascade.py | 6 +-- paste/cgitb_catcher.py | 4 +- paste/cowbell/__init__.py | 2 +- 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 ++-- paste/exceptions/collector.py | 12 +++--- paste/exceptions/errormiddleware.py | 22 +++++------ paste/exceptions/formatter.py | 6 +-- paste/exceptions/serial_number_generator.py | 2 +- paste/flup_session.py | 4 +- paste/lint.py | 10 ++--- paste/modpython.py | 60 ++++++++++++++--------------- paste/proxy.py | 56 +++++++++++++-------------- paste/reloader.py | 2 +- paste/request.py | 6 +-- paste/url.py | 16 ++++---- paste/util/UserDict24.py | 2 +- paste/util/dateinterval.py | 4 +- paste/util/filemixin.py | 2 +- paste/util/finddata.py | 2 +- paste/util/findpackage.py | 2 +- paste/util/looper.py | 6 +-- paste/util/scgiserver.py | 8 ++-- paste/util/template.py | 12 +++--- paste/util/threadedprint.py | 2 +- paste/wsgilib.py | 10 ++--- paste/wsgiwrappers.py | 46 +++++++++++----------- 37 files changed, 185 insertions(+), 185 deletions(-) (limited to 'paste') diff --git a/paste/__init__.py b/paste/__init__.py index ba66606..4e2d638 100644 --- a/paste/__init__.py +++ b/paste/__init__.py @@ -6,7 +6,7 @@ try: except ImportError: # don't prevent use of paste if pkg_resources isn't installed from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) + __path__ = extend_path(__path__, __name__) try: import modulefinder diff --git a/paste/auth/basic.py b/paste/auth/basic.py index 69db128..24d1731 100644 --- a/paste/auth/basic.py +++ b/paste/auth/basic.py @@ -108,14 +108,14 @@ def make_basic(app, global_conf, realm, authfunc, **kw): use = egg:Paste#auth_basic realm=myrealm authfunc=somepackage.somemodule:somefunction - + """ from paste.util.import_string import eval_import import types authfunc = eval_import(authfunc) assert isinstance(authfunc, types.FunctionType), "authfunc must resolve to a function" return AuthBasicHandler(app, realm, authfunc) - + if "__main__" == __name__: import doctest diff --git a/paste/auth/cookie.py b/paste/auth/cookie.py index c636824..14b1fd8 100644 --- a/paste/auth/cookie.py +++ b/paste/auth/cookie.py @@ -368,7 +368,7 @@ def make_auth_cookie( The maximum length of the cookie that is sent (default 4k, which is a typical browser maximum) - + """ if isinstance(scanlist, six.string_types): scanlist = scanlist.split() diff --git a/paste/auth/form.py b/paste/auth/form.py index 4e6aa49..9be82a2 100644 --- a/paste/auth/form.py +++ b/paste/auth/form.py @@ -131,7 +131,7 @@ def make_form(app, global_conf, realm, authfunc, **kw): use = egg:Paste#auth_form realm=myrealm authfunc=somepackage.somemodule:somefunction - + """ from paste.util.import_string import eval_import import types diff --git a/paste/auth/grantip.py b/paste/auth/grantip.py index 4ea6df5..2ee9bcf 100644 --- a/paste/auth/grantip.py +++ b/paste/auth/grantip.py @@ -38,7 +38,7 @@ class GrantIPMiddleware(object): if roles and isinstance(roles, six.string_types): roles = roles.split(',') return (username, roles) - + def __call__(self, environ, start_response): addr = ip4.ip2int(environ['REMOTE_ADDR'], False) remove_user = False @@ -74,8 +74,8 @@ class GrantIPMiddleware(object): if role in cur_roles: cur_roles.remove(role) environ['REMOTE_USER_TOKENS'] = ','.join(cur_roles) - - + + def make_grantip(app, global_conf, clobber_username=False, **kw): """ Grant roles or usernames based on IP addresses. @@ -93,7 +93,7 @@ def make_grantip(app, global_conf, clobber_username=False, **kw): 192.168.0.7 = joe # And one IP is should not be logged in: 192.168.0.10 = __remove__:-editor - + """ from paste.deploy.converters import asbool clobber_username = asbool(clobber_username) @@ -110,5 +110,5 @@ def make_grantip(app, global_conf, clobber_username=False, **kw): role = '' ip_map[key] = value return GrantIPMiddleware(app, ip_map, clobber_username) - - + + diff --git a/paste/auth/open_id.py b/paste/auth/open_id.py index 967e699..f79f7f8 100644 --- a/paste/auth/open_id.py +++ b/paste/auth/open_id.py @@ -91,20 +91,20 @@ class AuthOpenIDHandler(object): ``app`` Your WSGI app to call - + ``data_store_path`` Directory to store crypto data in for use with OpenID servers. - + ``auth_prefix`` Location for authentication process/verification - + ``login_redirect`` Location to load after successful process of login - + ``catch_401`` If true, then any 401 responses will turn into open ID login requirements. - + ``url_to_username`` A function called like ``url_to_username(environ, url)``, which should return a string username. If not given, the URL will be the username. diff --git a/paste/cascade.py b/paste/cascade.py index 424794e..8207ae3 100644 --- a/paste/cascade.py +++ b/paste/cascade.py @@ -15,7 +15,7 @@ __all__ = ['Cascade'] def make_cascade(loader, global_conf, catch='404', **local_conf): """ Entry point for Paste Deploy configuration - + Expects configuration like:: [composit:cascade] @@ -39,7 +39,7 @@ def make_cascade(loader, global_conf, catch='404', **local_conf): apps.sort() apps = [app for name, app in apps] return Cascade(apps, catch=catch) - + class Cascade(object): """ @@ -70,7 +70,7 @@ class Cascade(object): self.catch_codes[code] = exc self.catch_exceptions.append(exc) self.catch_exceptions = tuple(self.catch_exceptions) - + def __call__(self, environ, start_response): """ WSGI application interface diff --git a/paste/cgitb_catcher.py b/paste/cgitb_catcher.py index 55a346f..3185506 100644 --- a/paste/cgitb_catcher.py +++ b/paste/cgitb_catcher.py @@ -83,7 +83,7 @@ class CgitbMiddleware(object): format=self.format) hook(*exc_info) return dummy_file.getvalue() - + def make_cgitb_middleware(app, global_conf, display=NoDefault, logdir=None, @@ -92,7 +92,7 @@ def make_cgitb_middleware(app, global_conf, """ Wraps the application in the ``cgitb`` (standard library) error catcher. - + display: If true (or debug is set in the global configuration) then the traceback will be displayed in the browser diff --git a/paste/cowbell/__init__.py b/paste/cowbell/__init__.py index 43b7097..5a0d22d 100644 --- a/paste/cowbell/__init__.py +++ b/paste/cowbell/__init__.py @@ -45,7 +45,7 @@ function showSomewhere() { var sec, el; if (cowbellState == 'hidden') { el = document.getElementById('cowbell-ascending'); - lastCowbellPosition = [parseInt(Math.random()*(window.innerWidth-200)), + lastCowbellPosition = [parseInt(Math.random()*(window.innerWidth-200)), parseInt(Math.random()*(window.innerHeight-200))]; el.style.left = lastCowbellPosition[0] + 'px'; el.style.top = lastCowbellPosition[1] + 'px'; 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 - +