GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — matplotlib.github.com/cleanout.py at master · righteousrenegade/matplotlib.github.com Expand file tree/ Copy pathcleanout.pyMore file actions 33 lines (26 loc) · 1.05 KB / Copy pathcleanout.pyFile metadata and controls33 lines (26 loc) · 1.05 KB 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 import os import sys """ Cleans out the top-level (latest) docs from old files. Requires a single commandline argument for the latest version. """ redirect = """ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="refresh" content="0; url=index.html"/> </head> </html> """ latest = sys.argv[-1] for tree in ('examples', '_images', 'mpl_examples', 'plot_directive', 'devel', 'users', 'api', 'faq', 'glossary'): for root, dirs, files in os.walk(tree): for file in files: if not os.path.exists(os.path.join(latest, root, file)): print(os.path.join(root, file)) if file.endswith('.html'): with open(os.path.join(root, file), 'w') as fd: fd.write(redirect.strip()) elif file.endswith('.py') or file.endswith('.png') or file.endswith('.pdf'): os.system('git rm ' + os.path.join(root, file)) |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |