Commit 58e82c25 authored by Vincent Pelletier's avatar Vincent Pelletier

Store default match as None.

For future serialisation support flexibility.
parent 64dcab76
...@@ -634,7 +634,7 @@ period_parser = { ...@@ -634,7 +634,7 @@ period_parser = {
), ),
} }
def asHTML(out, per_site, args, period_parameter_dict, stats): def asHTML(out, per_site, args, default_site, period_parameter_dict, stats):
period = period_parameter_dict['period'] period = period_parameter_dict['period']
decimator = period_parameter_dict['decimator'] decimator = period_parameter_dict['decimator']
date_format = period_parameter_dict['date_format'] date_format = period_parameter_dict['date_format']
...@@ -678,6 +678,8 @@ def asHTML(out, per_site, args, period_parameter_dict, stats): ...@@ -678,6 +678,8 @@ def asHTML(out, per_site, args, period_parameter_dict, stats):
out.write('<tr><td>%s</td><td>%s</td></tr>' % (date, hit)) out.write('<tr><td>%s</td><td>%s</td></tr>' % (date, hit))
out.write('</table>') out.write('</table>')
for site_id, data in per_site.iteritems(): for site_id, data in per_site.iteritems():
if site_id is None:
site_id = default_site
out.write('<h1>Site: %s</h1>' % site_id) out.write('<h1>Site: %s</h1>' % site_id)
out.write( out.write(
graphPair( graphPair(
...@@ -895,7 +897,7 @@ def main(): ...@@ -895,7 +897,7 @@ def main():
if prefix_match(url) is not None: if prefix_match(url) is not None:
break break
else: else:
site = default_site site = None
action = default_action action = default_action
if action is None: if action is None:
skipped_lines += 1 skipped_lines += 1
...@@ -939,7 +941,7 @@ def main(): ...@@ -939,7 +941,7 @@ def main():
else: else:
out = open(args.out, 'w') out = open(args.out, 'w')
with out: with out:
format_generator[args.format](out, per_site, args, { format_generator[args.format](out, per_site, args, default_site, {
'period': period, 'period': period,
'decimator': decimator, 'decimator': decimator,
'date_format': date_format, 'date_format': date_format,
......
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