# -*- coding: utf-8 -*- import os ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) template = """ """ errors = { "dl-in-p": "

text
text

", "header-in-dt": "
text
text
", "footer-in-dt": "
text
text
", "article-in-dt": "

text

text
", "aside-in-dt": "
text
", "nav-in-dt": "
text
", "section-in-dt": "

text

text
", "h1-in-dt": "

text

text
", "h2-in-dt": "

text

text
", "h3-in-dt": "

text

text
", "h4-in-dt": "

text

text
", "h5-in-dt": "
text
text
", "h6-in-dt": "
text
text
", "hgroup-in-dt": "

text

text
", "only-dt": "
1
", "only-dd": "
a
", "first-dd": "
a
2
b
", "last-dt": "
1
a
2
", "dd-in-template": "
1
", "dt-in-template": "
a
", "dl-contains-text": "
1
x
", "dl-contains-text-2": "
1
a
x
", "dl-contains-dl": "
1
a
", # div "empty-div": "
", "empty-div-2": "
2
b
", "mixed-dt-dd-div": "
1
a
2
b
", "mixed-div-dt-dd": "
1
a
2
b
", "nested-divs": "
1
a
", "div-splitting-groups": "
1
a
", "div-splitting-groups-2": "
1
a
b
", "div-splitting-groups-3": "
1
2
b
", "div-contains-text": "
x
2
b
", "div-contains-dl": "
2
b
", "div-multiple-groups": "
1
a
2
a
b
3
4
5
a
", } non_errors_in_head = { "parent-template-in-head": "", } non_errors = { "basic": "
text
text
", "empty": "
", "empty-dt-dd": "
", "multiple-groups": "
1
a
2
a
b
3
4
5
a
", "header-in-dd": "
text
text
", "footer-in-dd": "
text
", "article-in-dd": "
text

text

", "aside-in-dd": "
text
", "nav-in-dd": "
text
", "section-in-dd": "
text

text

", "h1-in-dd": "
text

text

", "h2-in-dd": "
text

text

", "h3-in-dd": "
text

text

", "h4-in-dd": "
text

text

", "h5-in-dd": "
text
text
", "h6-in-dd": "
text
text
", "p-in-dt": "

1

1

a
", "dl-in-dt": "
1
a
b
", "dl-in-dd": "
1
2
a
", "interactive": "
1
a
", "script": "
", "dt-script-dd": "
1
a
", "dt-template-dd": "
1
a
", # div "div-basic": "
1
a
", "div-script": "
1
a
", "div-script-2": "
1
a
", "div-template": "
1
a
", "div-template-2": "
1
a
", "div-multiple-groups": "
1
a
2
a
b
3
4
5
a
", } for key in errors.keys(): template_error = template template_error += 'invalid %s\n' % key template_error += errors[key] file = open(os.path.join(ccdir, "html/elements/dl/%s-novalid.html" % key), 'w') file.write(template_error) file.close() file = open(os.path.join(ccdir, "html/elements/dl/dl-isvalid.html"), 'w') file.write(template + 'valid dl\n') for key in non_errors_in_head.keys(): file.write('%s \n' % (non_errors_in_head[key], key)) file.write('\n') for key in non_errors.keys(): file.write('%s \n' % (non_errors[key], key)) file.close() # vim: ts=4:sw=4