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
Monitor
Service Desk
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
d61fb7f7
Commit
d61fb7f7
authored
7 months ago
by
Alex Marchant
Committed by
jvoisin
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Wait to remove elements until they are all processed
parent
1aed4ff2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#258663
failed
3 months ago
Stage: linting
Stage: test
Changes
1
Pipelines
18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libmat2/office.py
+7
-1
7 additions, 1 deletion
libmat2/office.py
with
7 additions
and
1 deletion
libmat2/office.py
+
7
−
1
View file @
d61fb7f7
...
...
@@ -283,9 +283,15 @@ class MSOfficeParser(ZipParser):
for
children
in
element
.
iterfind
(
'
./*
'
):
elements_ins
.
append
((
element
,
position
,
children
))
break
for
(
element
,
position
,
children
)
in
elements_ins
:
parent_map
[
element
].
insert
(
position
,
children
)
parent_map
[
element
].
remove
(
element
)
# the list can sometimes contain duplicate elements, so don't remove
# until all children have been processed
for
(
element
,
position
,
children
)
in
elements_ins
:
if
element
in
parent_map
[
element
]:
parent_map
[
element
].
remove
(
element
)
tree
.
write
(
full_path
,
xml_declaration
=
True
,
encoding
=
'
utf-8
'
)
return
True
...
...
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