Python jinja2.utils.missing() Examples
The following are 17
code examples of jinja2.utils.missing().
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: debug.py From Building-Recommendation-Systems-with-Python with MIT License | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #2
Source File: debug.py From android_universal with MIT License | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #3
Source File: debug.py From Carnets with BSD 3-Clause "New" or "Revised" License | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #4
Source File: debug.py From EDCOP with Apache License 2.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #5
Source File: debug.py From odoo13-x64 with GNU General Public License v3.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #6
Source File: debug.py From PhonePi_SampleServer with MIT License | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #7
Source File: debug.py From planespotter with MIT License | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #8
Source File: debug.py From cadquery-freecad-module with GNU Lesser General Public License v3.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #9
Source File: debug.py From scylla with Apache License 2.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #10
Source File: debug.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #11
Source File: debug.py From Building-Recommendation-Systems-with-Python with MIT License | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #12
Source File: debug.py From pySINDy with MIT License | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #13
Source File: debug.py From OpenXR-SDK-Source with Apache License 2.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #14
Source File: debug.py From RSSNewsGAE with Apache License 2.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #15
Source File: debug.py From recruit with Apache License 2.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #16
Source File: debug.py From recruit with Apache License 2.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals
Example #17
Source File: debug.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: locals = ctx.get_all().copy() else: locals = {} local_overrides = {} for name, value in iteritems(real_locals): if not name.startswith('l_') or value is missing: continue try: _, depth, name = name.split('_', 2) depth = int(depth) except ValueError: continue cur_depth = local_overrides.get(name, (-1,))[0] if cur_depth < depth: local_overrides[name] = (depth, value) for name, (_, value) in iteritems(local_overrides): if value is missing: locals.pop(name, None) else: locals[name] = value return locals