Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MKDocs Template
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PAGoDA
Tools
MKDocs Template
Commits
061a1db8
Verified
Commit
061a1db8
authored
4 years ago
by
Romain Deville
Browse files
Options
Downloads
Patches
Plain Diff
Improve plugins.py via black in tox
parent
4e46e9bf
No related branches found
No related tags found
No related merge requests found
Pipeline
#9388
canceled with stages
Stage:
Stage:
Stage:
Stage:
Stage:
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/_data/plugins.py
+11
-10
11 additions, 10 deletions
docs/_data/plugins.py
templates/docs/_data/plugins.py
+11
-10
11 additions, 10 deletions
templates/docs/_data/plugins.py
with
22 additions
and
20 deletions
docs/_data/plugins.py
+
11
−
10
View file @
061a1db8
...
@@ -153,10 +153,14 @@ def add_external_to_nav(
...
@@ -153,10 +153,14 @@ def add_external_to_nav(
repo_parent
,
repo_parent
,
nav_parent
[
1
:],
nav_parent
[
1
:],
)
)
elif
repo_dict
[
"
online_url
"
].
startswith
(
'
/
'
):
elif
repo_dict
[
"
online_url
"
].
startswith
(
"
/
"
):
nav
.
append
({
nav
.
append
(
repo_dict
[
"
nav_entry
"
]:
repo_dict
[
"
online_url
"
].
replace
(
'
/
'
,
'
../
'
,
1
)
{
})
repo_dict
[
"
nav_entry
"
]:
repo_dict
[
"
online_url
"
].
replace
(
"
/
"
,
"
../
"
,
1
)
}
)
else
:
else
:
nav
.
append
({
repo_dict
[
"
nav_entry
"
]:
repo_dict
[
"
online_url
"
]})
nav
.
append
({
repo_dict
[
"
nav_entry
"
]:
repo_dict
[
"
online_url
"
]})
...
@@ -406,9 +410,7 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
...
@@ -406,9 +410,7 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
curr_year
=
time
.
strftime
(
"
%Y
"
,
time
.
localtime
())
curr_year
=
time
.
strftime
(
"
%Y
"
,
time
.
localtime
())
if
first_year
==
curr_year
:
if
first_year
==
curr_year
:
env
.
variables
[
env
.
variables
[
"
date_copyright
"
]
=
f
"
Copyright ©
{
curr_year
}
"
"
date_copyright
"
]
=
f
"
Copyright ©
{
curr_year
}
"
else
:
else
:
env
.
variables
[
env
.
variables
[
"
date_copyright
"
"
date_copyright
"
...
@@ -419,7 +421,6 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
...
@@ -419,7 +421,6 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
]
=
f
"
{
env
.
variables
[
'
date_copyright
'
]
}
{
env
.
variables
[
'
copyright
'
]
}
"
]
=
f
"
{
env
.
variables
[
'
date_copyright
'
]
}
{
env
.
variables
[
'
copyright
'
]
}
"
def
set_repo_name
(
env
:
dict
,
repo_slug
:
str
)
->
None
:
def
set_repo_name
(
env
:
dict
,
repo_slug
:
str
)
->
None
:
"""
Update content of the `repo_name` key in `env.conf`.
"""
Update content of the `repo_name` key in `env.conf`.
...
@@ -834,8 +835,8 @@ def update_version(env: dict) -> None:
...
@@ -834,8 +835,8 @@ def update_version(env: dict) -> None:
minor
=
int
(
i_tag
[
1
])
minor
=
int
(
i_tag
[
1
])
patch
=
str
()
patch
=
str
()
for
i_remain_tag
in
i_tag
[
2
:]:
for
i_remain_tag
in
i_tag
[
2
:]:
if
i_remain_tag
and
i_remain_tag
not
in
(
""
,
"
\n
"
):
if
i_remain_tag
and
i_remain_tag
not
in
(
""
,
"
\n
"
):
i_remain_tag
=
i_remain_tag
.
replace
(
"
\n
"
,
""
)
i_remain_tag
=
i_remain_tag
.
replace
(
"
\n
"
,
""
)
if
not
patch
:
if
not
patch
:
patch
=
f
"
{
i_remain_tag
}
"
patch
=
f
"
{
i_remain_tag
}
"
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
templates/docs/_data/plugins.py
+
11
−
10
View file @
061a1db8
...
@@ -153,10 +153,14 @@ def add_external_to_nav(
...
@@ -153,10 +153,14 @@ def add_external_to_nav(
repo_parent
,
repo_parent
,
nav_parent
[
1
:],
nav_parent
[
1
:],
)
)
elif
repo_dict
[
"
online_url
"
].
startswith
(
'
/
'
):
elif
repo_dict
[
"
online_url
"
].
startswith
(
"
/
"
):
nav
.
append
({
nav
.
append
(
repo_dict
[
"
nav_entry
"
]:
repo_dict
[
"
online_url
"
].
replace
(
'
/
'
,
'
../
'
,
1
)
{
})
repo_dict
[
"
nav_entry
"
]:
repo_dict
[
"
online_url
"
].
replace
(
"
/
"
,
"
../
"
,
1
)
}
)
else
:
else
:
nav
.
append
({
repo_dict
[
"
nav_entry
"
]:
repo_dict
[
"
online_url
"
]})
nav
.
append
({
repo_dict
[
"
nav_entry
"
]:
repo_dict
[
"
online_url
"
]})
...
@@ -406,9 +410,7 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
...
@@ -406,9 +410,7 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
curr_year
=
time
.
strftime
(
"
%Y
"
,
time
.
localtime
())
curr_year
=
time
.
strftime
(
"
%Y
"
,
time
.
localtime
())
if
first_year
==
curr_year
:
if
first_year
==
curr_year
:
env
.
variables
[
env
.
variables
[
"
date_copyright
"
]
=
f
"
Copyright ©
{
curr_year
}
"
"
date_copyright
"
]
=
f
"
Copyright ©
{
curr_year
}
"
else
:
else
:
env
.
variables
[
env
.
variables
[
"
date_copyright
"
"
date_copyright
"
...
@@ -419,7 +421,6 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
...
@@ -419,7 +421,6 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
]
=
f
"
{
env
.
variables
[
'
date_copyright
'
]
}
{
env
.
variables
[
'
copyright
'
]
}
"
]
=
f
"
{
env
.
variables
[
'
date_copyright
'
]
}
{
env
.
variables
[
'
copyright
'
]
}
"
def
set_repo_name
(
env
:
dict
,
repo_slug
:
str
)
->
None
:
def
set_repo_name
(
env
:
dict
,
repo_slug
:
str
)
->
None
:
"""
Update content of the `repo_name` key in `env.conf`.
"""
Update content of the `repo_name` key in `env.conf`.
...
@@ -834,8 +835,8 @@ def update_version(env: dict) -> None:
...
@@ -834,8 +835,8 @@ def update_version(env: dict) -> None:
minor
=
int
(
i_tag
[
1
])
minor
=
int
(
i_tag
[
1
])
patch
=
str
()
patch
=
str
()
for
i_remain_tag
in
i_tag
[
2
:]:
for
i_remain_tag
in
i_tag
[
2
:]:
if
i_remain_tag
and
i_remain_tag
not
in
(
""
,
"
\n
"
):
if
i_remain_tag
and
i_remain_tag
not
in
(
""
,
"
\n
"
):
i_remain_tag
=
i_remain_tag
.
replace
(
"
\n
"
,
""
)
i_remain_tag
=
i_remain_tag
.
replace
(
"
\n
"
,
""
)
if
not
patch
:
if
not
patch
:
patch
=
f
"
{
i_remain_tag
}
"
patch
=
f
"
{
i_remain_tag
}
"
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment