|
72 | 72 |
|
73 | 73 |
|
74 | 74 | # find files that need to be renamed |
75 | | -files_rename_qs = [] |
76 | | -files_rename_quot = [] |
77 | | -files_loader = [] |
| 75 | +files_rename_qs = [] # remove query string |
| 76 | +files_rename_quot = [] # remove quotes |
| 77 | +files_loader = [] # files served by load.php |
78 | 78 | for root, dirnames, filenames in os.walk('output/reference/'): |
79 | 79 | for filename in fnmatch.filter(filenames, '*[?]*'): |
80 | 80 | files_rename_qs.append((root, filename)) |
|
90 | 90 | rename_map = [] |
91 | 91 | def rename_file(root, fn, new_fn): |
92 | 92 | path = os.path.join(root,fn) |
| 93 | + if not os.path.isfile(path): |
| 94 | + print("Not renaming " + path) |
| 95 | + return |
93 | 96 | new_path = os.path.join(root,new_fn) |
94 | 97 | shutil.move(path, new_path) |
95 | 98 | rename_map.append((fn, new_fn)) |
@@ -117,6 +120,11 @@ def rename_file(root, fn, new_fn): |
117 | 120 |
|
118 | 121 | rename_file(root, fn, new_fn) |
119 | 122 |
|
| 123 | +# rename filenames that conflict on case-insensitive filesystems |
| 124 | +# TODO: perform this automatically |
| 125 | +rename_file('output/reference/en/cpp/numeric/math', 'NAN.html', 'NAN.2.html') |
| 126 | +rename_file('output/reference/en/c/numeric/math', 'NAN.html', 'NAN.2.html') |
| 127 | + |
120 | 128 | # find files that need to be preprocessed |
121 | 129 | html_files = [] |
122 | 130 | for root, dirnames, filenames in os.walk('output/reference/'): |
|
0 commit comments