small fixes

- fixed a bug where table header was rendered for titles with no book
children
- now correctly parsing url (some of the record whereat parsed properly)
This commit is contained in:
geritol
2017-09-30 13:15:49 +02:00
committed by Vishnu Ks
parent 7c18180613
commit 416796678b
3 changed files with 28 additions and 17 deletions

View File

@@ -23,8 +23,9 @@ def render(in_file, out_file, library):
# render chapter and start of the table
out_file.write(line)
out_file.write('| Name | Author | Goodreads Rating | Year Published | \n')
out_file.write('|------|--------|------------------|----------------| \n')
if len(library[line.strip()]) > 0:
out_file.write('| Name | Author | Goodreads Rating | Year Published | \n')
out_file.write('|------|--------|------------------|----------------| \n')
# render books
for book in library[line.strip()]:
out_file.write(render_book_line(book))