Menu
"""
def mk_html_list(dict_list, keys, sort_keys, divider_fn=None):
if divider_fn is None:
print ('
')
else:
print '
'
def sort_fn(d):
return tuple(d[k] for k in sort_keys)
prev_d = None
if sort_keys is not None:
it = sorted(dict_list, key=sort_fn)
else:
it = dict_list
for d in it:
if divider_fn is not None:
divider_text = divider_fn(d, prev_d)
if divider_text is not None:
print '
%s
' % divider_text
print "
"
for k in keys:
value = d[k]
if k == "description":
if value:
print '
%s
' % value
continue
if value.endswith(".png"):
value = (''
% value)
print ' %s' % (k, value)
print "