-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate.py
More file actions
35 lines (24 loc) · 792 Bytes
/
generate.py
File metadata and controls
35 lines (24 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
We are setting up this redirect by autogenerated 35K pages with this redirect
https://trac.sagemath.org/ticket/[number] -->
https://github.com/sagemath/sage/issues/[number]
"""
import os
from pathlib import Path
def mkdir(d):
Path(d).mkdir(parents=True, exist_ok=True)
mkdir('ticket')
def redirect(n):
return f"""<!DOCTYPE html>
<html>
<body style="margin: 30px">
<p>This ticket is now <a href="https://github.com/sagemath/sage/issues/{n}">hosted on GitHub</a>.</p>
<p>
There is also <a href="https://web.archive.org/web/20230130064641/https://trac.sagemath.org/ticket/{n}">a read-only archive at web.archive.org</a>.
</p>
</body>
</html>
"""
for n in range(1, 35200):
mkdir(f'ticket/{n}')
open(f"ticket/{n}/index.html", 'w').write(redirect(n))