Allow no editors info in pdf, epub.
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Mon, 30 Jun 2014 09:31:04 +0000 (11:31 +0200)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Mon, 30 Jun 2014 09:31:04 +0000 (11:31 +0200)
librarian/epub.py
librarian/pdf.py

index 8ef436e..1ea2688 100644 (file)
@@ -502,8 +502,10 @@ def transform(wldoc, verbose=False,
             document.edoc.getroot().set(flag, 'yes')
 
     # add editors info
             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))
     if document.book_info.funders:
         document.edoc.getroot().set('funders', u', '.join(
             document.book_info.funders))
index 7aaff10..12c07ea 100644 (file)
@@ -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('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:
         if document.book_info.funders:
             root.set('funders', u', '.join(document.book_info.funders))
         if document.book_info.thanks: