Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

support when bottle is not in the pythonpath

  • Loading branch information...
commit 8cfa8e094bf84fb8c81d780dac8927c28c2d0ef8 1 parent 3c68a85
@jtolds authored
Showing with 10 additions and 10 deletions.
  1. +10 −10 bottle.py
View
20 bottle.py
@@ -3064,9 +3064,9 @@ def wrapper(*args, **kwargs):
#: The default template used for error pages. Override with @error()
ERROR_PAGE_TEMPLATE = """
-%try:
- %from bottle import DEBUG, HTTP_CODES, request, touni
- %status_name = HTTP_CODES.get(e.status, 'Unknown').title()
+%%try:
+ %%from %s import DEBUG, HTTP_CODES, request, touni
+ %%status_name = HTTP_CODES.get(e.status, 'Unknown').title()
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
@@ -3083,21 +3083,21 @@ def wrapper(*args, **kwargs):
<p>Sorry, the requested URL <tt>{{repr(request.url)}}</tt>
caused an error:</p>
<pre>{{e.output}}</pre>
- %if DEBUG and e.exception:
+ %%if DEBUG and e.exception:
<h2>Exception:</h2>
<pre>{{repr(e.exception)}}</pre>
- %end
- %if DEBUG and e.traceback:
+ %%end
+ %%if DEBUG and e.traceback:
<h2>Traceback:</h2>
<pre>{{e.traceback}}</pre>
- %end
+ %%end
</body>
</html>
-%except ImportError:
+%%except ImportError:
<b>ImportError:</b> Could not generate the error page. Please add bottle to
the import path.
-%end
-"""
+%%end
+""" % __name__
#: A thread-safe instance of :class:`LocalRequest`. If accessed from within a
#: request callback, this instance always refers to the *current* request

4 comments on commit 8cfa8e0

@defnull

This is actually a nice patch. I'd like this without the zero-copy plugin please :)

@jtolds
Owner

i don't know how to submit two pull requests. you should just be able to cherry pick this commit

@defnull

Yes, I am, but I'm lazy, too :) Nevermind, I'll just cherry-pick.

@jtolds
Owner

lol

Please sign in to comment.
Something went wrong with that request. Please try again.