Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
19f939a4
Commit
19f939a4
authored
8 years ago
by
Kennyl
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update epub.py
initialize covefile to None first
parent
896dc046
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
epub.py
cps/epub.py
+1
-2
No files found.
cps/epub.py
View file @
19f939a4
...
...
@@ -49,6 +49,7 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension):
epub_metadata
[
s
]
=
"Unknown"
coversection
=
tree
.
xpath
(
"/pkg:package/pkg:manifest/pkg:item[@id='cover-image']/@href"
,
namespaces
=
ns
)
coverfile
=
None
if
len
(
coversection
)
>
0
:
coverfile
=
extractCover
(
zip
,
coversection
[
0
],
coverpath
,
tmp_file_path
)
else
:
...
...
@@ -71,8 +72,6 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension):
meta_cover_content
=
tree
.
xpath
(
"/pkg:package/pkg:manifest/pkg:item[@id='"
+
meta_cover
[
0
]
+
"']/@href"
,
namespaces
=
ns
)
if
len
(
meta_cover_content
)
>
0
:
coverfile
=
extractCover
(
zip
,
meta_cover_content
[
0
],
coverpath
,
tmp_file_path
)
else
:
coverfile
=
None
if
epub_metadata
[
'title'
]
is
None
:
title
=
original_file_name
...
...
This diff is collapsed.
Click to expand it.
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