Commit 46f63fd5 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix NameError when only one site is present/matched.

parent 14e3c000
...@@ -829,10 +829,10 @@ def asHTML(out, encoding, per_site, args, default_site, period_parameter_dict, ...@@ -829,10 +829,10 @@ def asHTML(out, encoding, per_site, args, default_site, period_parameter_dict,
out.write('<script type="text/javascript" src="%s/%s"></script>' % ( out.write('<script type="text/javascript" src="%s/%s"></script>' % (
js_path, script)) js_path, script))
out.write('</head><body><h1>Overall</h1>') out.write('</head><body><h1>Overall</h1>')
if len(per_site) > 1:
out.write('<h2>Index</h2><ol>')
site_list = list(enumerate(sorted(per_site.iteritems(), site_list = list(enumerate(sorted(per_site.iteritems(),
key=lambda x: site_caption_dict[x[0]]))) key=lambda x: site_caption_dict[x[0]])))
if len(per_site) > 1:
out.write('<h2>Index</h2><ol>')
html_site_caption_dict = {} html_site_caption_dict = {}
for i, (site_id, _) in site_list: for i, (site_id, _) in site_list:
html_caption = unquoteToHtml(site_caption_dict[site_id], encoding) html_caption = unquoteToHtml(site_caption_dict[site_id], encoding)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment