Skip to content

Commit

Permalink
Fix content.opf's <dc:source>
Browse files Browse the repository at this point in the history
  • Loading branch information
bebound committed Oct 1, 2016
1 parent d236e13 commit 1e1327c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
15 changes: 4 additions & 11 deletions epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,7 @@ def __init__(self, output_dir=None, cover_path=None, single_thread=False, out_fo
self.out_format = out_format

self.uuid = str(uuid.uuid1())
self.chapters = kwargs['chapters']
self.volume_name = kwargs['volume_name']
self.volume_number = kwargs['volume_number']
self.author = kwargs['author']
self.illustrator = kwargs['illustrator']
self.introduction = kwargs['introduction']
self.cover_url = kwargs['cover_url']
self.book_name = kwargs['book_name']
self.filename = kwargs['filename']
self.date = kwargs['date']
self.__dict__.update(kwargs)
self.base_path = ''
self.pictures = []
self.generated_file = ''
Expand Down Expand Up @@ -241,7 +232,9 @@ def create_content_opf_xml(self):
final_content_opf_xml = content_opf_xml.format(book_name=html.escape(self.book_name),
volume_number=self.volume_number,
uuid=self.uuid,
cover_name='img' + cover_name, date=self.date,
cover_name='img' + cover_name,
source=self.source,
date=self.date,
introduction=html.escape(self.introduction),
author=self.author,
file_paths='\n'.join(file_paths),
Expand Down
2 changes: 1 addition & 1 deletion novel.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ def get_novel_information(self):
Return:
A list contains dict, dict usually has these information: volume_name, volume_number, book_name,
author, illustrator, introduction, chapters, cover_url, date
author, illustrator, introduction, chapters, cover_url, date, source
"""
pass
2 changes: 1 addition & 1 deletion novel_360dxs.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def parse_book(self, tag):
{'chapters': self.chapters, 'volume_name': self.volume_name, 'volume_number': self.volume_number,
'book_name': self.book_name, 'filename': self.filename, 'author': self.author,
'illustrator': self.illustrator, 'introduction': self.introduction,
'cover_url': self.cover_url, 'date': self.date})
'cover_url': self.cover_url, 'date': self.date, 'source': self.url})
self.chapters = []
self.chapter_links = []

Expand Down
2 changes: 1 addition & 1 deletion novel_wenku8.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def parse_book(self, volume_title, urls):
{'chapters': self.chapters, 'volume_name': self.volume_name, 'volume_number': self.volume_number,
'book_name': self.book_name, 'filename': self.filename, 'author': self.author,
'illustrator': self.illustrator, 'introduction': self.introduction,
'cover_url': self.cover_url, 'date': self.date})
'cover_url': self.cover_url, 'date': self.date, 'source': self.url})
self.chapters = []
self.chapter_links = []

Expand Down
2 changes: 1 addition & 1 deletion templates/content.opf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<dc:title>{book_name} {volume_number}</dc:title>
<dc:creator opf:file-as="{author}" opf:role="aut">{author}</dc:creator>
<dc:language>zh</dc:language>
<dc:source>http://www.lightnovel.cn</dc:source>
<dc:source>{source}</dc:source>
<dc:description>{introduction}</dc:description>
<dc:date>{date}</dc:date>
<dc:publisher>linovel</dc:publisher>
Expand Down

0 comments on commit 1e1327c

Please sign in to comment.