Skip to content

Commit

Permalink
Beautify code slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
cryzed committed Jul 3, 2016
1 parent 77e6a09 commit 3a0c290
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions make-ebook
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ def main():
book.set_cover(FRONT_COVER_FILE_NAME, file.read())
book.get_item_with_id('cover').is_linear = True

# End cover image
back_cover_image = epub.EpubCover('back-cover-img', 'cover.jpg')
# Back cover image
back_cover_image = epub.EpubCover('back-cover-image', BACK_COVER_FILE_NAME)
with open(BACK_COVER_FILE_NAME, 'rb') as file:
back_cover_image.content = file.read()
book.add_item(back_cover_image)

# End cover html
back_cover = epub.EpubCoverHtml('back-cover', 'back-cover.xhtml', 'cover.jpg')
# Back cover html
back_cover = epub.EpubCoverHtml('back-cover', 'back-cover.xhtml', BACK_COVER_FILE_NAME)
back_cover.is_linear = True
book.add_item(back_cover)

Expand All @@ -54,6 +54,7 @@ def main():
for id_, (username, created) in sorted(spine.items(), key=lambda item: item[1][1]):
with open(os.path.join('parts', username, id_ + '.html')) as file:
html_content = file.read()

with open(os.path.join('parts', username, id_ + '.txt')) as file:
text = file.read()

Expand Down
1 change: 1 addition & 0 deletions scrape-reddit-parts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def main():
for id_, (created, html, text) in parts.items():
with open(os.path.join('parts', username, id_ + '.html'), 'w', encoding='UTF-8') as file:
file.write(html)

with open(os.path.join('parts', username, id_ + '.txt'), 'w', encoding='UTF-8') as file:
file.write(text)

Expand Down

0 comments on commit 3a0c290

Please sign in to comment.