24
24
loader = LOADER , extensions = EXTENSIONS )
25
25
26
26
27
- def render_resources (database , resource_type , template_names ):
27
+ def render_resources (database , resource_type , localsite , template_names ):
28
28
"""
29
29
Render resources of the given type. They are queried from the given
30
30
database and rendered using the first template from template_names that can
@@ -38,7 +38,7 @@ def render_resources(database, resource_type, template_names):
38
38
else :
39
39
return template .render (resource_type = resource_type ,
40
40
resources = resources , metaparams = METAPARAMS ,
41
- env = os .environ )
41
+ env = os .environ , localsite = localsite )
42
42
43
43
44
44
def main ():
@@ -51,6 +51,7 @@ def main():
51
51
parser .add_argument ('--debug' , '-d' , action = 'store_true' )
52
52
parser .add_argument ('--host' , '-H' , default = 'localhost' )
53
53
parser .add_argument ('--port' , '-p' , default = '8080' )
54
+ parser .add_argument ('--localsite' , '-l' , default = 'true' )
54
55
55
56
args = parser .parse_args ()
56
57
logging .basicConfig (level = logging .DEBUG if args .debug else logging .WARN )
@@ -61,7 +62,7 @@ def main():
61
62
templates = ['{0}.jinja2' .format (resource_type )]
62
63
if args .templates :
63
64
templates += args .templates
64
- print (render_resources (database , resource_type , templates ))
65
+ print (render_resources (database , resource_type , args . localsite , templates ))
65
66
66
67
67
68
if __name__ == '__main__' :
0 commit comments