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
148bcbba
Commit
148bcbba
authored
4 years ago
by
Julien (jvoisin) Voisin
Browse files
Options
Downloads
Patches
Plain Diff
Bump coverage
parent
b3def8b5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libmat2/office.py
+3
-3
3 additions, 3 deletions
libmat2/office.py
libmat2/pdf.py
+1
-1
1 addition, 1 deletion
libmat2/pdf.py
with
4 additions
and
4 deletions
libmat2/office.py
+
3
−
3
View file @
148bcbba
...
...
@@ -147,7 +147,7 @@ class MSOfficeParser(ZipParser):
except
ET
.
ParseError
:
return
False
for
c
in
tree
:
if
'
PartName
'
not
in
c
.
attrib
or
'
ContentType
'
not
in
c
.
attrib
:
if
'
PartName
'
not
in
c
.
attrib
or
'
ContentType
'
not
in
c
.
attrib
:
# pragma: no cover
continue
elif
c
.
attrib
[
'
ContentType
'
]
in
self
.
content_types_to_keep
:
fname
=
c
.
attrib
[
'
PartName
'
][
1
:]
# remove leading `/`
...
...
@@ -270,7 +270,7 @@ class MSOfficeParser(ZipParser):
logging
.
error
(
"
Unable to parse %s: %s
"
,
full_path
,
e
)
return
False
if
len
(
namespace
.
items
())
!=
1
:
if
len
(
namespace
.
items
())
!=
1
:
# pragma: no cover
logging
.
debug
(
"
Got several namespaces for Types: %s
"
,
namespace
.
items
())
removed_fnames
=
set
()
...
...
@@ -361,7 +361,7 @@ class MSOfficeParser(ZipParser):
if
full_path
.
endswith
(
'
/[Content_Types].xml
'
):
# this file contains references to files that we might
# remove, and MS Office doesn't like dangling references
if
self
.
__remove_content_type_members
(
full_path
)
is
False
:
if
self
.
__remove_content_type_members
(
full_path
)
is
False
:
# pragma: no cover
return
False
elif
full_path
.
endswith
(
'
/word/document.xml
'
):
# this file contains the revisions
...
...
This diff is collapsed.
Click to expand it.
libmat2/pdf.py
+
1
−
1
View file @
148bcbba
...
...
@@ -84,7 +84,7 @@ class PDFParser(abstract.AbstractParser):
for
pagenum
in
range
(
pages_count
):
page
=
document
.
get_page
(
pagenum
)
if
page
is
None
:
if
page
is
None
:
# pragma: no cover
logging
.
error
(
"
Unable to get PDF pages
"
)
return
False
page_width
,
page_height
=
page
.
get_size
()
...
...
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