Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
jvoisin
mat2
Commits
f8111547
Commit
f8111547
authored
Jan 30, 2021
by
jvoisin
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve epub compatibility
parent
88fa71fb
Pipeline
#53465
failed with stages
in 9 minutes and 20 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
libmat2/epub.py
libmat2/epub.py
+3
-2
No files found.
libmat2/epub.py
View file @
f8111547
...
...
@@ -15,11 +15,12 @@ class EPUBParser(archive.ZipParser):
'META-INF/container.xml'
,
'mimetype'
,
'OEBPS/content.opf'
,
'content.opf'
,
}))
self
.
uniqid
=
uuid
.
uuid4
()
def
_specific_get_meta
(
self
,
full_path
,
file_path
):
if
file_path
!=
'OEBPS/
content.opf'
:
if
not
file_path
.
endswith
(
'
content.opf'
)
:
return
{}
with
open
(
full_path
,
encoding
=
'utf-8'
)
as
f
:
...
...
@@ -31,7 +32,7 @@ class EPUBParser(archive.ZipParser):
return
{
file_path
:
'harmful content'
,
}
def
_specific_cleanup
(
self
,
full_path
:
str
):
if
full_path
.
endswith
(
'
OEBPS/
content.opf'
):
if
full_path
.
endswith
(
'content.opf'
):
return
self
.
__handle_contentopf
(
full_path
)
elif
full_path
.
endswith
(
'OEBPS/toc.ncx'
):
return
self
.
__handle_tocncx
(
full_path
)
...
...
jvoisin
@jvoisin
mentioned in issue
#148
·
Jan 30, 2021
mentioned in issue
#148
mentioned in issue #148
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment