fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
beeae2c
)
add option to choose cover class
author
Jan Szejko
<janek37@gmail.com>
Tue, 2 Oct 2018 11:39:32 +0000
(13:39 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Tue, 2 Oct 2018 11:39:32 +0000
(13:39 +0200)
src/catalogue/management/commands/gencover.py
patch
|
blob
|
history
diff --git
a/src/catalogue/management/commands/gencover.py
b/src/catalogue/management/commands/gencover.py
index
420ea63
..
ec010a5
100644
(file)
--- a/
src/catalogue/management/commands/gencover.py
+++ b/
src/catalogue/management/commands/gencover.py
@@
-14,12
+14,17
@@
class Command(BaseCommand):
parser.add_argument('--width', type=int)
parser.add_argument('--height', type=int)
parser.add_argument('--bleed', action='store_true')
parser.add_argument('--width', type=int)
parser.add_argument('--height', type=int)
parser.add_argument('--bleed', action='store_true')
+ parser.add_argument('--cover-class', type=str)
def handle(self, *args, **options):
slug = options['slug']
width = options['width']
height = options.get('height')
def handle(self, *args, **options):
slug = options['slug']
width = options['width']
height = options.get('height')
+ cover_class = options.get('cover_class')
bleed = 20 if options['bleed'] else 0
wldoc = Book.objects.get(slug=slug).wldocument()
bleed = 20 if options['bleed'] else 0
wldoc = Book.objects.get(slug=slug).wldocument()
- cover = make_cover(wldoc.book_info, width=width, height=height, bleed=bleed)
+ kwargs = {}
+ if cover_class:
+ kwargs['cover_class'] = cover_class
+ cover = make_cover(wldoc.book_info, width=width, height=height, bleed=bleed, **kwargs)
cover.save('%s.jpg' % slug)
cover.save('%s.jpg' % slug)