Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-mako
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-mako
Commits
808dde14
Commit
808dde14
authored
14 years ago
by
Mike Bayer
Browse files
Options
Downloads
Patches
Plain Diff
- Fixed call to "unicode.strip" in
exceptions.text_error_template which is not Py3k compatible. [ticket:137]
parent
6fbcfe7a
No related branches found
Branches containing commit
Tags
rel_0_2_1
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGES
+5
-1
5 additions, 1 deletion
CHANGES
mako/__init__.py
+1
-1
1 addition, 1 deletion
mako/__init__.py
mako/exceptions.py
+1
-1
1 addition, 1 deletion
mako/exceptions.py
test/test_exceptions.py
+16
-4
16 additions, 4 deletions
test/test_exceptions.py
with
23 additions
and
7 deletions
CHANGES
+
5
−
1
View file @
808dde14
0.3.4
- Fixed call to "unicode.strip" in
exceptions.text_error_template which
is not Py3k compatible. [ticket:137]
0.3.3
0.3.3
- Added conditional to RichTraceback
- Added conditional to RichTraceback
such that if no traceback is passed
such that if no traceback is passed
...
...
This diff is collapsed.
Click to expand it.
mako/__init__.py
+
1
−
1
View file @
808dde14
...
@@ -5,5 +5,5 @@
...
@@ -5,5 +5,5 @@
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__version__
=
'
0.3.
3
'
__version__
=
'
0.3.
4
'
This diff is collapsed.
Click to expand it.
mako/exceptions.py
+
1
−
1
View file @
808dde14
...
@@ -247,7 +247,7 @@ def text_error_template(lookup=None):
...
@@ -247,7 +247,7 @@ def text_error_template(lookup=None):
Traceback (most recent call last):
Traceback (most recent call last):
% for (filename, lineno, function, line) in tback.traceback:
% for (filename, lineno, function, line) in tback.traceback:
File
"
${filename}
"
, line ${lineno}, in ${function or
'
?
'
}
File
"
${filename}
"
, line ${lineno}, in ${function or
'
?
'
}
${line |
unicode.s
tri
p
}
${line | tri
m
}
% endfor
% endfor
${tback.errorname}: ${tback.message}
${tback.errorname}: ${tback.message}
"""
)
"""
)
...
...
This diff is collapsed.
Click to expand it.
test/test_exceptions.py
+
16
−
4
View file @
808dde14
...
@@ -17,12 +17,12 @@ class ExceptionsTest(TemplateTest):
...
@@ -17,12 +17,12 @@ class ExceptionsTest(TemplateTest):
try
:
try
:
template
=
Template
(
code
)
template
=
Template
(
code
)
template
.
render_unicode
()
template
.
render_unicode
()
assert
False
except
exceptions
.
CompileException
,
ce
:
except
exceptions
.
CompileException
,
ce
:
html_error
=
exceptions
.
html_error_template
().
render_unicode
()
html_error
=
exceptions
.
html_error_template
().
render_unicode
()
assert
(
"
CompileException: Fragment
'
i = 0
'
is not a partial
"
assert
(
"
CompileException: Fragment
'
i = 0
'
is not a partial
"
"
control statement
"
)
in
html_error
"
control statement
"
)
in
html_error
assert
'
<style>
'
in
html_error
assert
'
<style>
'
in
html_error
assert
'
</style>
'
in
html_error
html_error_stripped
=
html_error
.
strip
()
html_error_stripped
=
html_error
.
strip
()
assert
html_error_stripped
.
startswith
(
'
<html>
'
)
assert
html_error_stripped
.
startswith
(
'
<html>
'
)
assert
html_error_stripped
.
endswith
(
'
</html>
'
)
assert
html_error_stripped
.
endswith
(
'
</html>
'
)
...
@@ -30,18 +30,30 @@ class ExceptionsTest(TemplateTest):
...
@@ -30,18 +30,30 @@ class ExceptionsTest(TemplateTest):
not_full
=
exceptions
.
html_error_template
().
\
not_full
=
exceptions
.
html_error_template
().
\
render_unicode
(
full
=
False
)
render_unicode
(
full
=
False
)
assert
'
<html>
'
not
in
not_full
assert
'
<html>
'
not
in
not_full
assert
'
</html>
'
not
in
not_full
assert
'
<style>
'
in
not_full
assert
'
<style>
'
in
not_full
assert
'
</style>
'
in
not_full
no_css
=
exceptions
.
html_error_template
().
\
no_css
=
exceptions
.
html_error_template
().
\
render_unicode
(
css
=
False
)
render_unicode
(
css
=
False
)
assert
'
<style>
'
not
in
no_css
assert
'
<style>
'
not
in
no_css
assert
'
</style>
'
not
in
no_css
else
:
else
:
assert
False
,
(
"
This function should trigger a CompileException,
"
assert
False
,
(
"
This function should trigger a CompileException,
"
"
but didn
'
t
"
)
"
but didn
'
t
"
)
def
test_text_error_template
(
self
):
code
=
"""
% i = 0
"""
try
:
template
=
Template
(
code
)
template
.
render_unicode
()
assert
False
except
exceptions
.
CompileException
,
ce
:
text_error
=
exceptions
.
text_error_template
().
render_unicode
()
assert
'
Traceback (most recent call last):
'
in
text_error
assert
(
"
CompileException: Fragment
'
i = 0
'
is not a partial
"
"
control statement
"
)
in
text_error
def
test_utf8_html_error_template
(
self
):
def
test_utf8_html_error_template
(
self
):
"""
test the html_error_template with a Template containing utf8
"""
test the html_error_template with a Template containing utf8
chars
"""
chars
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment