Created
October 25, 2010 11:14
-
-
Save dchaplinsky/644792 to your computer and use it in GitHub Desktop.
Patch for coffin extensions example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- misc.py~ 2010-10-25 14:07:30.000000000 +0300 | |
+++ misc.py 2010-10-25 14:13:56.000000000 +0300 | |
@@ -1,5 +1,6 @@ | |
from coffin import template | |
-from jinja2 import Markup | |
+from jinja2 import Markup, nodes | |
+from jinja2.ext import Extension | |
register = template.Library() | |
@register.filter(jinja2_only=True) | |
@@ -12,7 +13,7 @@ | |
""" Outputs 'world' """ | |
return "world" | |
-@register.test(is_a_string, 'string') | |
+@register.test() | |
def is_a_string(value): | |
return isinstance(value, basestring) | |
@@ -23,7 +24,7 @@ | |
def parse(self, parser): | |
lineno = parser.stream.next().lineno | |
- body = parser.parse_statements(['name:endspaceless'], drop_needle=True) | |
+ body = parser.parse_statements(['name:enduseless'], drop_needle=True) | |
return nodes.CallBlock( | |
self.call_method('_do_nothing', [], [], None, None), | |
[], [], body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment