"""Create the shell reading's website files and simplified access logs."""
from pathlib import Path

folder = Path('shell-practice')
folder.mkdir()
files = {
    '.gitignore': 'reports/\n',
    'access-2026-10-12.log': (
        '2026-10-12 09:00 200 GET /\n'
        '2026-10-12 09:01 200 GET /about\n'
        '2026-10-12 09:02 404 GET /cats\n'
        '2026-10-12 09:03 404 GET /favicon.ico\n'
        '2026-10-12 09:04 200 GET /images/cat.png\n'
        '2026-10-12 09:05 500 GET /search\n'
        '2026-10-12 09:06 200 GET /Cats\n'
        '2026-10-12 09:07 404 GET /old-page\n'
    ),
    'access-2026-10-11.log': (
        '2026-10-11 10:00 200 GET /\n'
        '2026-10-11 10:01 404 GET /old-page\n'
    ),
    'access-2026-10-10.log': (
        '2026-10-10 10:00 200 GET /\n'
        '2026-10-10 10:01 404 GET /cats\n'
    ),
    'access-2026-10-02.log': '2026-10-02 10:00 200 GET /\n',
    'webpage/index.html': '<!doctype html>\n<a href="/old-page">Cat photos</a>\n',
    'webpage/style.css': 'body { color: red; }\n',
}
for name, contents in files.items():
    path = folder / name
    path.parent.mkdir(parents=True, exist_ok=True)
    path.write_text(contents, encoding='utf-8')
print('Created', folder)
