diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-04-21 15:26:47 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-04-21 15:26:47 +0200 |
commit | 04ecd5542849191457ccfc3e42a39452db47825a (patch) | |
tree | b0a470e46326b709d090a900847bbb004d355607 /paste/exceptions | |
parent | 4c177fce89fee925f0f4fbfde00ce2e1252562c0 (diff) | |
download | paste-04ecd5542849191457ccfc3e42a39452db47825a.tar.gz |
Strip trailing spaces
Diffstat (limited to 'paste/exceptions')
-rw-r--r-- | paste/exceptions/collector.py | 12 | ||||
-rw-r--r-- | paste/exceptions/errormiddleware.py | 22 | ||||
-rw-r--r-- | paste/exceptions/formatter.py | 6 | ||||
-rw-r--r-- | paste/exceptions/serial_number_generator.py | 2 |
4 files changed, 21 insertions, 21 deletions
diff --git a/paste/exceptions/collector.py b/paste/exceptions/collector.py index d6a30db..8867bf7 100644 --- a/paste/exceptions/collector.py +++ b/paste/exceptions/collector.py @@ -92,7 +92,7 @@ class ExceptionCollector(object): The actually interpretation of these values is largely up to the reporters and formatters. - + ``collect_exception(*sys.exc_info())`` will return an object with several attributes: @@ -113,7 +113,7 @@ class ExceptionCollector(object): can refer to the exception later. (@@: should it include a portion that allows identification of the specific instance of the exception as well?) - + The list of frames goes innermost first. Each frame has these attributes; some values may be None if they could not be determined. @@ -140,7 +140,7 @@ class ExceptionCollector(object): the value of any ``__traceback_hide__`` variable ``traceback_log``: the value of any ``__traceback_log__`` variable - + ``__traceback_supplement__`` is thrown away, but a fixed set of attributes are captured; each of these attributes is @@ -189,7 +189,7 @@ class ExceptionCollector(object): hide frames that are part of the 'framework' or underlying system. There are a variety of rules about special values for this variables that formatters should be aware of. - + TODO: More attributes in __traceback_supplement__? Maybe an attribute @@ -503,7 +503,7 @@ class ExceptionFrame(Bunch): for lineno in range(self.lineno-context, self.lineno+context+1): lines.append(linecache.getline(self.filename, lineno)) return ''.join(lines) - + if hasattr(sys, 'tracebacklimit'): limit = min(limit, sys.tracebacklimit) @@ -512,7 +512,7 @@ col = ExceptionCollector() def collect_exception(t, v, tb, limit=None): """ Collection an exception from ``sys.exc_info()``. - + Use like:: try: diff --git a/paste/exceptions/errormiddleware.py b/paste/exceptions/errormiddleware.py index 7a0918a..3202ee2 100644 --- a/paste/exceptions/errormiddleware.py +++ b/paste/exceptions/errormiddleware.py @@ -23,7 +23,7 @@ class ErrorMiddleware(object): """ Error handling middleware - + Usage:: error_catching_wsgi_app = ErrorMiddleware(wsgi_app) @@ -34,14 +34,14 @@ class ErrorMiddleware(object): If true, then tracebacks will be shown in the browser. ``error_email``: - an email address (or list of addresses) to send exception + an email address (or list of addresses) to send exception reports to ``error_log``: a filename to append tracebacks to ``show_exceptions_in_wsgi_errors``: - If true, then errors will be printed to ``wsgi.errors`` + If true, then errors will be printed to ``wsgi.errors`` (frequently a server error log, or stderr). ``from_address``, ``smtp_server``, ``error_subject_prefix``, ``smtp_username``, ``smtp_password``, ``smtp_use_tls``: @@ -57,7 +57,7 @@ class ErrorMiddleware(object): HTML page. Environment Configuration: - + ``paste.throw_errors``: If this setting in the request environment is true, then this middleware is disabled. This can be useful in a testing situation @@ -65,10 +65,10 @@ class ErrorMiddleware(object): ``paste.expected_exceptions``: When this middleware encounters an exception listed in this - environment variable and when the ``start_response`` has not + environment variable and when the ``start_response`` has not yet occurred, the exception will be re-raised instead of being - caught. This should generally be set by middleware that may - (but probably shouldn't be) installed above this middleware, + caught. This should generally be set by middleware that may + (but probably shouldn't be) installed above this middleware, and wants to get certain exceptions. Exceptions raised after ``start_response`` have been called are always caught since by definition they are no longer expected. @@ -123,7 +123,7 @@ class ErrorMiddleware(object): if xmlhttp_key is None: xmlhttp_key = global_conf.get('xmlhttp_key', '_') self.xmlhttp_key = xmlhttp_key - + def __call__(self, environ, start_response): """ The WSGI application interface. @@ -313,7 +313,7 @@ class Supplement(object): (1, 0, 1): 'CGI', (1, 1, 1): 'Multi thread/process CGI (?)', } - + def handle_exception(exc_info, error_stream, html=True, debug_mode=False, error_email=None, @@ -321,8 +321,8 @@ def handle_exception(exc_info, error_stream, html=True, show_exceptions_in_wsgi_errors=False, error_email_from='errors@localhost', smtp_server='localhost', - smtp_username=None, - smtp_password=None, + smtp_username=None, + smtp_password=None, smtp_use_tls=False, error_subject_prefix='', error_message=None, diff --git a/paste/exceptions/formatter.py b/paste/exceptions/formatter.py index 7fa5e7d..c83ab50 100644 --- a/paste/exceptions/formatter.py +++ b/paste/exceptions/formatter.py @@ -196,7 +196,7 @@ class TextFormatter(AbstractFormatter): '%s: %s' % (self.quote(etype), self.quote(evalue))) def format_traceback_info(self, info): return info - + def format_combine(self, data_by_importance, lines, exc_info): lines[:0] = [value for n, value in data_by_importance['important']] lines.append(exc_info) @@ -380,7 +380,7 @@ function switch_source(el, hide_type) { } </script>''' - + error_css = """ <style type="text/css"> @@ -464,7 +464,7 @@ def format_html(exc_data, include_hidden_frames=False, **ops): <textarea style="width: 100%%" rows=10 cols=60>%s</textarea> </div> """ % (short_er, long_er, cgi.escape(text_er)) - + def format_text(exc_data, **ops): return TextFormatter(**ops).format_collected_data(exc_data) diff --git a/paste/exceptions/serial_number_generator.py b/paste/exceptions/serial_number_generator.py index d4f6235..5315b7c 100644 --- a/paste/exceptions/serial_number_generator.py +++ b/paste/exceptions/serial_number_generator.py @@ -122,4 +122,4 @@ __test__ = { if __name__ == '__main__': import doctest doctest.testmod() - + |