Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lesson Template
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
prace-lessons
Lesson Template
Commits
7e835fdc
Commit
7e835fdc
authored
7 years ago
by
Raniere Silva
Browse files
Options
Downloads
Patches
Plain Diff
Remove check for all_figures.html now that we are using Javascript
parent
a747be0b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/lesson_check.py
+0
-34
0 additions, 34 deletions
bin/lesson_check.py
with
0 additions
and
34 deletions
bin/lesson_check.py
+
0
−
34
View file @
7e835fdc
...
...
@@ -31,7 +31,6 @@ REQUIRED_FILES = {
'
%/LICENSE.md
'
:
True
,
'
%/README.md
'
:
False
,
'
%/_extras/discuss.md
'
:
True
,
'
%/_extras/figures.md
'
:
True
,
'
%/_extras/guide.md
'
:
True
,
'
%/index.md
'
:
True
,
'
%/reference.md
'
:
True
,
...
...
@@ -116,7 +115,6 @@ def main():
for
filename
in
docs
.
keys
():
checker
=
create_checker
(
args
,
filename
,
docs
[
filename
])
checker
.
check
()
check_figures
(
args
.
source_dir
,
args
.
reporter
)
args
.
reporter
.
report
()
...
...
@@ -257,38 +255,6 @@ def check_fileset(source_dir, reporter, filenames_present):
seen
)
def
check_figures
(
source_dir
,
reporter
):
"""
Check that all figures are present and referenced.
"""
# Get references.
try
:
all_figures_html
=
os
.
path
.
join
(
source_dir
,
'
_includes
'
,
'
all_figures.html
'
)
with
open
(
all_figures_html
,
'
r
'
)
as
reader
:
text
=
reader
.
read
()
figures
=
P_FIGURE_REFS
.
findall
(
text
)
referenced
=
[
os
.
path
.
split
(
f
)[
1
]
for
f
in
figures
if
'
/fig/
'
in
f
]
except
FileNotFoundError
as
e
:
reporter
.
add
(
all_figures_html
,
'
File not found
'
)
return
# Get actual image files (ignore non-image files).
fig_dir_path
=
os
.
path
.
join
(
source_dir
,
'
fig
'
)
actual
=
[
f
for
f
in
os
.
listdir
(
fig_dir_path
)
if
os
.
path
.
splitext
(
f
)[
1
]
in
IMAGE_FILE_SUFFIX
]
# Report differences.
unexpected
=
set
(
actual
)
-
set
(
referenced
)
reporter
.
check
(
not
unexpected
,
None
,
'
Unexpected image files: {0}
'
,
'
,
'
.
join
(
sorted
(
unexpected
)))
missing
=
set
(
referenced
)
-
set
(
actual
)
reporter
.
check
(
not
missing
,
None
,
'
Missing image files: {0}
'
,
'
,
'
.
join
(
sorted
(
missing
)))
def
create_checker
(
args
,
filename
,
info
):
"""
Create appropriate checker for file.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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