zF dZddlmZmZmZddlZddlmZddlm Z ej dee efde ded e fd Z ej dee efd e d e fd Z ee e ZdS)z[ useful context functions, see http://jinja.pocoo.org/docs/dev/api/#jinja2.contextfunction )AnyDictcastN)web)URLcontext __route_namepartsreturnc ttj|d}d}d|vr|d}|D]}||}t |t rt |}nWt |turt |}n1td |t |||||<|j |j di|}|r| |}|S)zFilter for generating urls. Usage: {{ url('the-view-name') }} might become "/path/to/view" or {{ url('item-details', id=123, query={'active': 'true'}) }} might become "/items/1?active=true". appNquery_z8argument value should be str or int, got {} -> [{}] {!r}) rr Applicationpop isinstancestrtypeint TypeErrorformatrouterurl_for with_query)rr r r querykeyvalurls v/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/aiohttp_jinja2/helpers.pyrr s  s / /C E5 (##Cj c3   c((CC #YY#  c((CC&&,fS$s))S&A&A c *#*\ " * 3 3U 3 3C $nnU## Jstatic_file_pathc|d} |d}n#t$rtddwxYwd|d|dS)aFilter for generating urls for static files. NOTE: you'll need to set app['static_root_url'] to be used as the root for the urls returned. Usage: {{ static('styles.css') }} might become "/static/styles.css" or "http://mycdn.example.com/styles.css" r static_root_urlzapp does not define a static root url 'static_root_url', you need to set the url root with app['static_root_url'] = ''.Nz{}/{}/)KeyError RuntimeErrorrrstriplstrip)rr!r static_urls rr)r)0s %.C*+  =     >>*++C002B2I2I#2N2N O OOs.)rstatic)__doc__typingrrrjinja2aiohttpryarlrcontextfunctionrrr)dictGLOBAL_HELPERSrr rr3s#"""""""""  T#s(^ 3      FPS#XP#P#PPPP* r