def asset(path): fspath = www_root + '/assets/' + path etag = '' try: etag = asset_etag(fspath) except Exception as e: tell_sentry(e, {}) return asset_url + path + (etag and '?etag=' + etag)
def asset(path): fspath = www_root+'/assets/'+path etag = '' try: etag = asset_etag(fspath) except Exception as e: tell_sentry(e, {}, allow_reraise=True) return asset_url+path+(etag and '?etag='+etag)
def asset(path): fspath = website.www_root+'/assets/'+path etag = '' try: etag = asset_etag(fspath) except Exception as e: website.tell_sentry(e, {}) return env.asset_url+path+(etag and '?etag='+etag)
def asset(*paths): for path in paths: fspath = www_root+'/assets/'+path etag = '' try: if env.cache_static: etag = asset_etag(fspath) else: os.stat(fspath) except FileNotFoundError as e: if path == paths[-1]: if not os.path.exists(fspath + '.spt'): tell_sentry(e, {}) else: continue except Exception as e: tell_sentry(e, {}) return asset_url+path+(etag and '?etag='+etag)