comparison jadestache.py @ 41:293a694304b8

reformat
author drewp@bigasterisk.com
date Sat, 19 Nov 2022 17:18:55 -0800
parents e86642cf7393
children
comparison
equal deleted inserted replaced
40:94181d521d6d 41:293a694304b8
6 class _JadeLoader(pystache.loader.Loader): 6 class _JadeLoader(pystache.loader.Loader):
7 """ 7 """
8 expands jade of incoming files. Also includes a cache so it doesn't 8 expands jade of incoming files. Also includes a cache so it doesn't
9 read the same file twice 9 read the same file twice
10 """ 10 """
11
11 def __init__(self, *args, **kw): 12 def __init__(self, *args, **kw):
12 pystache.renderer.Loader.__init__(self, *args, **kw) 13 pystache.renderer.Loader.__init__(self, *args, **kw)
13 self.seen = {} # path : expanded jade 14 self.seen = {} # path : expanded jade
14 15
15 def read(self, path, encoding=None): 16 def read(self, path, encoding=None):
35 same templates in the browser with js mustache. 36 same templates in the browser with js mustache.
36 37
37 Files need to end with .mustache since it's the mustache loader 38 Files need to end with .mustache since it's the mustache loader
38 that's going to look for them. 39 that's going to look for them.
39 """ 40 """
41
40 def __init__(self, *args, **kw): 42 def __init__(self, *args, **kw):
41 debug = False 43 debug = False
42 if 'debug' in kw: 44 if 'debug' in kw:
43 debug = kw['debug'] 45 debug = kw['debug']
44 del kw['debug'] 46 del kw['debug']