new cover type
authorJan Szejko <janek37@gmail.com>
Tue, 2 Oct 2018 11:37:39 +0000 (13:37 +0200)
committerJan Szejko <janek37@gmail.com>
Wed, 19 Dec 2018 13:43:16 +0000 (14:43 +0100)
librarian/cover.py
librarian/res/atrium-logo.png [new file with mode: 0644]

index 6390f8a..29e24c8 100644 (file)
@@ -564,13 +564,28 @@ class MPWCover(LogoWLCover):
     ]
 
 
+class AtriumCover(LogoWLCover):
+    gradient_logo_height = 58
+    gradient_logo_spacing = 25
+    gradient_logos = [
+        'res/atrium-logo.png',
+        'res/wl-logo-white.png',
+        'res/fnp-logo-white.png',
+    ]
+
+
 COVER_CLASSES = {
     'default': LogoWLCover,
     'kmlu': KMLUCover,
     'mpw': MPWCover,
+    'atrium': AtriumCover,
 }
 
 
 def make_cover(book_info, *args, **kwargs):
-    cover_class = COVER_CLASSES[book_info.cover_class]
+    if 'cover_class' in kwargs:
+        cover_class_name = kwargs.pop('cover_class')
+    else:
+        cover_class_name = book_info.cover_class
+    cover_class = COVER_CLASSES[cover_class_name]
     return cover_class(book_info, *args, **kwargs)
diff --git a/librarian/res/atrium-logo.png b/librarian/res/atrium-logo.png
new file mode 100644 (file)
index 0000000..35af904
Binary files /dev/null and b/librarian/res/atrium-logo.png differ