cellarspoon
3 years ago
No known key found for this signature in database
GPG Key ID: 3789458B3D0C410
1 changed files with
6 additions and
2 deletions
-
temp_index.py
|
@ -65,11 +65,15 @@ def select_fields(fields, content, styles, book): |
|
|
content.append(Spacer(1, 12)) |
|
|
content.append(Spacer(1, 12)) |
|
|
|
|
|
|
|
|
if "comments" in fields: |
|
|
if "comments" in fields: |
|
|
trimmed = " ".join([c.text for c in book.comments]).split()[:NUM_WORDS_COMMENT] |
|
|
trimmed = " ".join([c.text for c in book.comments]).split() |
|
|
comments = "{}...".format(" ".join(trimmed)) |
|
|
if len(trimmed) > NUM_WORDS_COMMENT: |
|
|
|
|
|
comments = "{}...".format(" ".join(trimmed[:NUM_WORDS_COMMENT])) |
|
|
|
|
|
else: |
|
|
|
|
|
comments = "{}".format(" ".join(trimmed[:NUM_WORDS_COMMENT])) |
|
|
tag = "<font size=10>{}</font>".format(strip_tags(comments)) |
|
|
tag = "<font size=10>{}</font>".format(strip_tags(comments)) |
|
|
pcomments = Paragraph(tag) |
|
|
pcomments = Paragraph(tag) |
|
|
content.append(pcomments) |
|
|
content.append(pcomments) |
|
|
|
|
|
content.append(Spacer(6, 12)) |
|
|
|
|
|
|
|
|
if "authors" in fields: |
|
|
if "authors" in fields: |
|
|
format_string = "<font size=12>{}</font>" |
|
|
format_string = "<font size=12>{}</font>" |
|
|