From a91e41e489588ebad550cd9e22d157062effa2ff Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 30 Jun 2014 11:31:04 +0200 Subject: [PATCH] Allow no editors info in pdf, epub. --- librarian/epub.py | 6 ++++-- librarian/pdf.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/librarian/epub.py b/librarian/epub.py index 8ef436e..1ea2688 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -502,8 +502,10 @@ def transform(wldoc, verbose=False, document.edoc.getroot().set(flag, 'yes') # add editors info - document.edoc.getroot().set('editors', u', '.join(sorted( - editor.readable() for editor in document.editors()))) + editors = document.editors() + if editors: + document.edoc.getroot().set('editors', u', '.join(sorted( + editor.readable() for editor in editors))) if document.book_info.funders: document.edoc.getroot().set('funders', u', '.join( document.book_info.funders)) diff --git a/librarian/pdf.py b/librarian/pdf.py index 7aaff10..12c07ea 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -230,8 +230,10 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None, root.set('customizations', u','.join(customizations)) # add editors info - root.set('editors', u', '.join(sorted( - editor.readable() for editor in document.editors()))) + editors = document.editors() + if editors: + root.set('editors', u', '.join(sorted( + editor.readable() for editor in editors))) if document.book_info.funders: root.set('funders', u', '.join(document.book_info.funders)) if document.book_info.thanks: -- 2.20.1