FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib.github.com/_websiteutils/fixcss.py at main · matplotlib/matplotlib.github.com · GitHub
matplotlib
/
matplotlib.github.com
Public
Notifications
You must be signed in to change notification settings
Fork
62
Star
29
Code
Issues
1
Pull requests
2
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib.github.com
/
_websiteutils
/
fixcss.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (49 loc) · 1.18 KB
Breadcrumbs
matplotlib.github.com
/
_websiteutils
/
fixcss.py
Copy path
File metadata and controls
56 lines (49 loc) · 1.18 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import
pathlib
import
tempfile
import
shutil
tocheck
=
[
pathlib
.
Path
(
f"
{
major
}
.
{
minor
}
.
{
micro
}
"
)
for
major
in
range
(
2
,
-
1
,
-
1
)
for
minor
in
range
(
6
,
-
1
,
-
1
)
for
micro
in
range
(
6
,
-
1
,
-
1
)
]
to_add
=
b"""
/* "Go to released version" message. */
#unreleased-message {
background: #d62728;
box-sizing: border-box;
color: #fff;
font-weight: bold;
left: 0;
min-height: 3em;
padding: 0.7em;
position: fixed;
top: 0;
width: 100%;
z-index: 10000;
}
#unreleased-message + div {
margin-top: 3em;
}
#unreleased-message a {
color: #fff;
text-decoration:underline;
}
"""
for
d
in
tocheck
:
fname
=
pathlib
.
Path
(
d
,
'_static'
,
'mpl.css'
)
if
fname
.
is_file
():
print
(
f'checking
{
fname
}
'
)
with
open
(
fname
)
as
f
:
if
not
"#unreleased-message"
in
f
.
read
():
doit
=
True
else
:
doit
=
False
if
doit
:
print
(
f'doing
{
d
}
'
)
with
tempfile
.
NamedTemporaryFile
(
delete
=
False
)
as
fout
:
with
open
(
fname
,
'rb'
)
as
f
:
fout
.
write
(
f
.
read
())
fout
.
write
(
to_add
)
print
(
f
.
name
)
shutil
.
move
(
fout
.
name
,
f
.
name
)
Back
|
FazBrowse Home
|
New Git URL