FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib.github.com/cleanout.py at master · abhiip/matplotlib.github.com · GitHub
abhiip
/
matplotlib.github.com
Public
forked from
matplotlib/matplotlib.github.com
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib.github.com
/
cleanout.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (26 loc) · 1.05 KB
Breadcrumbs
matplotlib.github.com
/
cleanout.py
Copy path
File metadata and controls
33 lines (26 loc) · 1.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
))
Back
|
FazBrowse Home
|
New Git URL