1+ import base64
12import io
3+ import json
24import pathlib
35import posixpath
46import typing
@@ -138,7 +140,8 @@ def __init__(self, url: str) -> None:
138140 self ._topdir = ''
139141
140142 def load_paths (self ) -> list [pathlib .Path ]:
141- r = httpx .get (self ._url )
143+ r = httpx .get (self ._url , follow_redirects = True )
144+ r .raise_for_status ()
142145 b = io .BytesIO (r .content )
143146 with zipfile .ZipFile (b , 'r' ) as zip_ref :
144147 names = [
@@ -152,6 +155,7 @@ def load_paths(self) -> list[pathlib.Path]:
152155
153156 def read (self , path : pathlib .Path ) -> bytes :
154157 r = httpx .get (self ._url , follow_redirects = True )
158+ r .raise_for_status ()
155159 b = io .BytesIO (r .content )
156160 with zipfile .ZipFile (b , 'r' ) as zip_ref :
157161 path = f"{ self ._topdir } /{ path } " if self ._topdir else path
@@ -223,11 +227,14 @@ class TemplateLoader(jinja2.BaseLoader):
223227 def __init__ (self , templates : list [Template ]):
224228 self .templates = templates
225229
230+ def uptodate (self ):
231+ return False
232+
226233 def get_source (self , environment : jinja2 .Environment , template : str ):
227234 for t in self .templates :
228235 if t .name == template :
229236 source = t .read ().decode ('utf-8' )
230- return source , t .path , None
237+ return source , t .path , self . uptodate
231238 raise jinja2 .TemplateNotFound (template )
232239
233240
0 commit comments