Flake 8 fixes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent 76402dc · Browse files · 1 file·+8 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+8 added−9 removed
- other:+8 added−9 removed
Provenance
- Commit
f0c987b- Tree
9d27ed9- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
76402dc
1 file changed+8 added−9 removed
modified:jinja2/parser.py+8 added-9 removed
12 unmodified lines13 from jinja2.lexer import describe_token, describe_token_expr14 from jinja2._compat import imap15 16 17-#: statements that callinto 17 _statement_keywords = frozenset(['for', 'if', 'block', 'extends', 'print',18 'macro', 'include', 'from', 'import',19 'set'])20 _compare_operators = frozenset(['eq', 'ne', 'lt', 'lteq', 'gt', 'gteq'])411 unmodified lines432 next(self.stream)433 ops.append(nodes.Operand(token_type, self.parse_add()))434 elif self.stream.skip_if('name:in'):435 ops.append(nodes.Operand('in', self.parse_add()))437- elif self.stream.current.test('name:not') and \438- self.stream.look().test('name:in'):436+ elif (self.stream.current.test('name:not') and437+ self.stream.look().test('name:in')):438 self.stream.skip(2)439 ops.append(nodes.Operand('notin', self.parse_add()))440 else:441 break327 unmodified lines769 dyn_kwargs = self.parse_expression()770 else:771 ensure(dyn_args is None and dyn_kwargs is None)772 if self.stream.current.type == 'name' and \774- self.stream.look().type == 'assign':773+ self.stream.look().type == 'assign':774 key = self.stream.current.value775 self.stream.skip(2)776 value = self.parse_expression()777 kwargs.append(nodes.Keyword(key, value,44 unmodified lines822 dyn_args = dyn_kwargs = None823 kwargs = []824 if self.stream.current.type == 'lparen':825 args, kwargs, dyn_args, dyn_kwargs = self.parse_call(None)827- elif self.stream.current.type in ('name', 'string', 'integer',828- 'float', 'lparen', 'lbracket',829- 'lbrace') and not \830- self.stream.current.test_any('name:else', 'name:or',831- 'name:and'):826+ elif (self.stream.current.type in ('name', 'string', 'integer',827+ 'float', 'lparen', 'lbracket',828+ 'lbrace') and not829+ self.stream.current.test_any('name:else', 'name:or',830+ 'name:and')):831 if self.stream.current.test('name:is'):832 self.fail('You cannot chain multiple tests with is')833 args = [self.parse_expression()]834 else:60 unmodified lines