equal
deleted
inserted
replaced
346 v = context.process(key, safemapping) |
346 v = context.process(key, safemapping) |
347 except TemplateNotFound: |
347 except TemplateNotFound: |
348 v = default |
348 v = default |
349 if callable(v) and getattr(v, '_requires', None) is None: |
349 if callable(v) and getattr(v, '_requires', None) is None: |
350 # old templatekw: expand all keywords and resources |
350 # old templatekw: expand all keywords and resources |
|
351 # (TODO: deprecate this after porting web template keywords to new API) |
351 props = {k: f(context, mapping, k) |
352 props = {k: f(context, mapping, k) |
352 for k, f in context._resources.items()} |
353 for k, f in context._resources.items()} |
|
354 # pass context to _showcompatlist() through templatekw._showlist() |
|
355 props['templ'] = context |
353 props.update(mapping) |
356 props.update(mapping) |
354 return v(**pycompat.strkwargs(props)) |
357 return v(**pycompat.strkwargs(props)) |
355 if callable(v): |
358 if callable(v): |
356 # new templatekw |
359 # new templatekw |
357 try: |
360 try: |