Skip to content
Myr

[svn] some small fixes for the jinja release

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 1223e09 · Browse files · 3 files+14 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+14 added−4 removed

  • other:+14 added−4 removed

3 files+14 added−4 removed

modified:jinja/lexer.py+4 added-3 removed
131 unmodified lines
132133 def tokeniter(self, source):134 """135 This method tokenizes the text and returns the tokens in a generator.136 Normally it's a better idea to use the `tokenize` function which137 returns a `TokenStream` but in some situations it can be useful138 to use this function since it can be marginally faster.136 Use this method if you just want to tokenize a template. The output137 you get is not compatible with the input the jinja parser wants. The138 parser uses the `tokenize` function with returns a `TokenStream` with139 some escaped tokens.140 """141 source = type(source)('\n').join(source.splitlines())142 pos = 0143 lineno = 1
91 unmodified lines
modified:jinja/parser.py+9 added
580 unmodified lines
581 # if if doesn't match any existing directive it's like a582 # template syntax error.583 if data in self.directives:584 node = self.directives[data](lineno, gen)585 # directive or endtag found, give a proper error message586 elif data in self.directives or \587 not data.endswith('_') and data.startswith('end'):588 raise TemplateSyntaxError('unexpected directive %r' %589 str(data), lineno,590 self.filename)591 # keyword or unknown name with trailing slash592 else:593 if data.endswith('_'):594 data = data[:-1]595 raise TemplateSyntaxError('unknown directive %r' %596 str(data), lineno,597 self.filename)598 # some tags like the extends tag do not output nodes.
37 unmodified lines
modified:Makefile+1 added-1 removed
13 unmodified lines
14documentation:15 @(cd docs; ./generate.py)1617webpage:18 @(cd www; ./generate.py)18 @(cd ../www; ./generate.py)1920release:21 @(python2.3 setup.py release bdist_egg; python2.4 setup.py release bdist_egg; python2.5 setup.py release bdist_egg sdist)