Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Macao Legacy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model 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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MACAO
Macao Legacy
Commits
b856d660
Commit
b856d660
authored
May 24, 2024
by
Eliott Sammier
Browse files
Options
Downloads
Patches
Plain Diff
Fix inverted error messages
parent
9a5c421f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Basilisk/MACAO/macao_12/extracted/extract_mosetp.py
+4
-2
4 additions, 2 deletions
Basilisk/MACAO/macao_12/extracted/extract_mosetp.py
with
4 additions
and
2 deletions
Basilisk/MACAO/macao_12/extracted/extract_mosetp.py
+
4
−
2
View file @
b856d660
...
...
@@ -46,7 +46,7 @@ def parse_mosetp(graph: Graph, filepath: str, id: str):
regex
=
re
.
compile
(
r
'
.*new PageContenu\(
"
(.*)
"
,
"
(.*)
"
,
"
(.*)
"
,
""
\);
'
)
# The lines we need are fairly basic, grep is much faster
# than a Python HTML parser to filter them
cmd_array
=
[
"
grep
"
,
"
new PageConten
t
(
"
,
filepath
]
cmd_array
=
[
"
grep
"
,
"
new PageConten
u
(
"
,
filepath
]
try
:
cmd
=
subprocess
.
run
(
cmd_array
,
...
...
@@ -59,11 +59,13 @@ def parse_mosetp(graph: Graph, filepath: str, id: str):
m
=
regex
.
match
(
line
)
if
m
is
not
None
:
# should always match but just in case
generate_triples
(
graph
,
id
,
m
.
group
(
2
),
m
.
group
(
1
),
index
)
else
:
eprint
(
f
"
page regex found no match on line
'
{
line
}
'"
)
except
FileNotFoundError
as
e
:
eprint
(
f
"
Failed to run
'
grep
'
:
{
e
.
strerror
}
:
{
e
.
filename
}
"
)
except
subprocess
.
CalledProcessError
as
e
:
if
e
.
returncode
==
1
:
eprint
(
f
"
{
filepath
}
:
page regex
found no match, skipping.
'"
)
eprint
(
f
"
{
filepath
}
:
grep
found no match, skipping.
'"
)
else
:
eprint
(
e
.
stderr
,
end
=
""
)
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