Add swappable CSS for HTML previews.
[librarian.git] / librarian / dcparser.py
index eeb750a..92afc01 100644 (file)
@@ -248,7 +248,7 @@ class WorkInfo(six.with_metaclass(DCInfo, object)):
         Field(DCNS('description'), 'description', required=False),
 
         Field(DCNS('source'), 'source_name', required=False),
         Field(DCNS('description'), 'description', required=False),
 
         Field(DCNS('source'), 'source_name', required=False),
-        Field(DCNS('source.URL'), 'source_url', required=False),
+        Field(DCNS('source.URL'), 'source_urls', salias='source_url', multiple=True, required=False),
         Field(DCNS('identifier.url'), 'url', WLURI, strict=as_wluri_strict),
         Field(DCNS('rights.license'), 'license', required=False),
         Field(DCNS('rights'), 'license_description'),
         Field(DCNS('identifier.url'), 'url', WLURI, strict=as_wluri_strict),
         Field(DCNS('rights.license'), 'license', required=False),
         Field(DCNS('rights'), 'license_description'),
@@ -297,7 +297,7 @@ class WorkInfo(six.with_metaclass(DCInfo, object)):
         desc = rdf_tag.find(".//" + RDFNS('Description'))
 
         if desc is None:
         desc = rdf_tag.find(".//" + RDFNS('Description'))
 
         if desc is None:
-            raise NoDublinCore("No DublinCore section found.")
+            raise NoDublinCore("There must be a '%s' element inside the RDF." % RDFNS('Description'))
 
         lang = None
         p = desc
 
         lang = None
         p = desc
@@ -468,6 +468,8 @@ class BookInfo(WorkInfo):
         Field(WLNS('coverBarColor'), 'cover_bar_color', required=False),
         Field(WLNS('coverBoxPosition'), 'cover_box_position', required=False),
         Field(WLNS('coverClass'), 'cover_class', default=['default']),
         Field(WLNS('coverBarColor'), 'cover_bar_color', required=False),
         Field(WLNS('coverBoxPosition'), 'cover_box_position', required=False),
         Field(WLNS('coverClass'), 'cover_class', default=['default']),
+        Field(WLNS('coverLogoUrl'), 'cover_logo_urls', multiple=True, required=False),
+
         Field('pdf-id',  'isbn_pdf',  required=False),
         Field('epub-id', 'isbn_epub', required=False),
         Field('mobi-id', 'isbn_mobi', required=False),
         Field('pdf-id',  'isbn_pdf',  required=False),
         Field('epub-id', 'isbn_epub', required=False),
         Field('mobi-id', 'isbn_mobi', required=False),