Skip to content

Commit

Permalink
Merge pull request lorenzodifuccia#245 from avineshwar/patch-1
Browse files Browse the repository at this point in the history
Stronger data structure validation
  • Loading branch information
lorenzodifuccia committed Nov 23, 2020
2 parents b8fd830 + 4cde49d commit 7f7eab4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions safaribooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def book_info(self, info):
("Title", info["title"]), ("Authors", ", ".join(aut["name"] for aut in info["authors"])),
("Identifier", info["identifier"]), ("ISBN", info["isbn"]),
("Publishers", ", ".join(pub["name"] for pub in info["publishers"])),
("Rights", info["rights"]),
("Rights", info["rights"] if "rights" in info and info["rights"] else ""),
("Description", description[:500] + "..." if len(description) >= 500 else description),
("Release Date", info["issued"]),
("URL", info["web_url"])
Expand Down Expand Up @@ -961,7 +961,7 @@ def create_content_opf(self):
escape(self.book_info["description"]),
subjects,
", ".join(escape(pub["name"]) for pub in self.book_info["publishers"]),
escape(self.book_info["rights"]) if self.book_info["rights"] else "",
escape(self.book_info["rights"]) if "rights" in self.book_info and self.book_info["rights"] else "",
self.book_info["issued"],
self.cover,
"\n".join(manifest),
Expand Down

0 comments on commit 7f7eab4

Please sign in to comment.