Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mat2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
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
jvoisin
mat2
Commits
7405955a
Unverified
Commit
7405955a
authored
1 year ago
by
Romain
Browse files
Options
Downloads
Patches
Plain Diff
parsers: Inherit the sandbox option when creating additional parsers
parent
e6564509
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!114
Fix sandbox usage
Pipeline
#179454
failed
1 year ago
Stage: linting
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libmat2/archive.py
+2
-0
2 additions, 0 deletions
libmat2/archive.py
libmat2/audio.py
+1
-0
1 addition, 0 deletions
libmat2/audio.py
with
3 additions
and
0 deletions
libmat2/archive.py
+
2
−
0
View file @
7405955a
...
...
@@ -161,6 +161,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
member_parser
,
_
=
parser_factory
.
get_parser
(
full_path
)
# type: ignore
if
member_parser
:
member_parser
.
sandbox
=
self
.
sandbox
local_meta
=
{
**
local_meta
,
**
member_parser
.
get_meta
()}
if
local_meta
:
...
...
@@ -248,6 +249,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
abort
=
True
continue
else
:
member_parser
.
sandbox
=
self
.
sandbox
if
member_parser
.
remove_all
()
is
False
:
logging
.
warning
(
"
In file %s, something went wrong
\
with the cleaning of %s
\
...
...
This diff is collapsed.
Click to expand it.
libmat2/audio.py
+
1
−
0
View file @
7405955a
...
...
@@ -82,6 +82,7 @@ class FLACParser(MutagenParser):
with
open
(
fname
,
'
wb
'
)
as
f
:
f
.
write
(
picture
.
data
)
p
,
_
=
parser_factory
.
get_parser
(
fname
)
# type: ignore
p
.
sandbox
=
self
.
sandbox
# Mypy chokes on ternaries :/
meta
[
name
]
=
p
.
get_meta
()
if
p
else
'
harmful data
'
# type: ignore
os
.
remove
(
fname
)
...
...
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