Python jinja2.utils.concat() Examples
The following are 30
code examples of jinja2.utils.concat().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
jinja2.utils
, or try the search function
.
Example #1
Source File: compiler.py From luci-py with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): block_frame = frame.inner() block_frame.inspect(node.body) aliases = self.push_scope(block_frame) self.pull_locals(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.pop_scope(aliases, block_frame) assignment_frame = self.make_assignment_frame(frame) self.newline(node) self.visit(node.target, assignment_frame) self.write(' = concat(%s)' % block_frame.buffer) self.export_assigned_vars(frame, assignment_frame) # -- Expression Visitors
Example #2
Source File: compiler.py From RSSNewsGAE with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(concat(%s))' % block_frame.buffer) self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #3
Source File: compiler.py From misp42splunk with GNU Lesser General Public License v3.0 | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #4
Source File: compiler.py From misp42splunk with GNU Lesser General Public License v3.0 | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #5
Source File: compiler.py From SA-ctf_scoreboard with Creative Commons Zero v1.0 Universal | 6 votes |
def visit_AssignBlock(self, node, frame): block_frame = frame.inner() block_frame.inspect(node.body) aliases = self.push_scope(block_frame) self.pull_locals(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.pop_scope(aliases, block_frame) assignment_frame = self.make_assignment_frame(frame) self.newline(node) self.visit(node.target, assignment_frame) self.write(' = concat(%s)' % block_frame.buffer) self.export_assigned_vars(frame, assignment_frame) # -- Expression Visitors
Example #6
Source File: compiler.py From recruit with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #7
Source File: compiler.py From odoo13-x64 with GNU General Public License v3.0 | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #8
Source File: compiler.py From odoo13-x64 with GNU General Public License v3.0 | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #9
Source File: compiler.py From recruit with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #10
Source File: compiler.py From recruit with Apache License 2.0 | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #11
Source File: compiler.py From PhonePi_SampleServer with MIT License | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(concat(%s))' % block_frame.buffer) self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #12
Source File: compiler.py From OpenXR-SDK-Source with Apache License 2.0 | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #13
Source File: compiler.py From OpenXR-SDK-Source with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #14
Source File: compiler.py From PhonePi_SampleServer with MIT License | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #15
Source File: compiler.py From pySINDy with MIT License | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #16
Source File: compiler.py From pySINDy with MIT License | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #17
Source File: compiler.py From Building-Recommendation-Systems-with-Python with MIT License | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #18
Source File: compiler.py From Building-Recommendation-Systems-with-Python with MIT License | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #19
Source File: compiler.py From luci-py with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): block_frame = frame.inner() block_frame.inspect(node.body) aliases = self.push_scope(block_frame) self.pull_locals(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.pop_scope(aliases, block_frame) assignment_frame = self.make_assignment_frame(frame) self.newline(node) self.visit(node.target, assignment_frame) self.write(' = concat(%s)' % block_frame.buffer) self.export_assigned_vars(frame, assignment_frame) # -- Expression Visitors
Example #20
Source File: compiler.py From Building-Recommendation-Systems-with-Python with MIT License | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #21
Source File: compiler.py From scylla with Apache License 2.0 | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #22
Source File: compiler.py From scylla with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #23
Source File: compiler.py From luci-py with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): block_frame = frame.inner() block_frame.inspect(node.body) aliases = self.push_scope(block_frame) self.pull_locals(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.pop_scope(aliases, block_frame) assignment_frame = self.make_assignment_frame(frame) self.newline(node) self.visit(node.target, assignment_frame) self.write(' = concat(%s)' % block_frame.buffer) self.export_assigned_vars(frame, assignment_frame) # -- Expression Visitors
Example #24
Source File: compiler.py From cadquery-freecad-module with GNU Lesser General Public License v3.0 | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #25
Source File: compiler.py From cadquery-freecad-module with GNU Lesser General Public License v3.0 | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors
Example #26
Source File: compiler.py From luci-py with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): block_frame = frame.inner() block_frame.inspect(node.body) aliases = self.push_scope(block_frame) self.pull_locals(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.pop_scope(aliases, block_frame) assignment_frame = self.make_assignment_frame(frame) self.newline(node) self.visit(node.target, assignment_frame) self.write(' = concat(%s)' % block_frame.buffer) self.export_assigned_vars(frame, assignment_frame) # -- Expression Visitors
Example #27
Source File: compiler.py From Financial-Portfolio-Flask with MIT License | 6 votes |
def visit_AssignBlock(self, node, frame): block_frame = frame.inner() block_frame.inspect(node.body) aliases = self.push_scope(block_frame) self.pull_locals(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.pop_scope(aliases, block_frame) assignment_frame = self.make_assignment_frame(frame) self.newline(node) self.visit(node.target, assignment_frame) self.write(' = concat(%s)' % block_frame.buffer) self.export_assigned_vars(frame, assignment_frame) # -- Expression Visitors
Example #28
Source File: compiler.py From luci-py with Apache License 2.0 | 6 votes |
def visit_AssignBlock(self, node, frame): block_frame = frame.inner() block_frame.inspect(node.body) aliases = self.push_scope(block_frame) self.pull_locals(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.pop_scope(aliases, block_frame) assignment_frame = self.make_assignment_frame(frame) self.newline(node) self.visit(node.target, assignment_frame) self.write(' = concat(%s)' % block_frame.buffer) self.export_assigned_vars(frame, assignment_frame) # -- Expression Visitors
Example #29
Source File: compiler.py From planespotter with MIT License | 6 votes |
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline('if context.eval_ctx.autoescape:') self.indent() self.writeline('return Markup(concat(%s))' % frame.buffer) self.outdent() self.writeline('else:') self.indent() self.writeline('return concat(%s)' % frame.buffer) self.outdent() return elif frame.eval_ctx.autoescape: self.writeline('return Markup(concat(%s))' % frame.buffer) return self.writeline('return concat(%s)' % frame.buffer)
Example #30
Source File: compiler.py From planespotter with MIT License | 6 votes |
def visit_AssignBlock(self, node, frame): self.push_assign_tracking() block_frame = frame.inner() # This is a special case. Since a set block always captures we # will disable output checks. This way one can use set blocks # toplevel even in extended templates. block_frame.require_output_check = False block_frame.symbols.analyze_node(node) self.enter_frame(block_frame) self.buffer(block_frame) self.blockvisit(node.body, block_frame) self.newline(node) self.visit(node.target, frame) self.write(' = (Markup if context.eval_ctx.autoescape ' 'else identity)(') if node.filter is not None: self.visit_Filter(node.filter, block_frame) else: self.write('concat(%s)' % block_frame.buffer) self.write(')') self.pop_assign_tracking(frame) self.leave_frame(block_frame) # -- Expression Visitors