X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/2d538a50605add2666172861744229599487f1b2..4628276e4a8f159cded83f8dbf7ec8239705f84a:/src/depot/publishers/base.py diff --git a/src/depot/publishers/base.py b/src/depot/publishers/base.py index b728cf24..88ee56b2 100644 --- a/src/depot/publishers/base.py +++ b/src/depot/publishers/base.py @@ -17,21 +17,31 @@ class BasePublisher: self.login() return self._session - def send_book(self, shop, book, changes=None): + def send_book(self, site_book_publish, changes=None): raise NotImplementedError() def get_description(self, wlbook, description_add=''): description = '' + + if wlbook.meta.audience in ('L', 'SP1', 'SP2', 'SP3', 'SP4'): + description += '

{} to lektura szkolna.'.format(wlbook.meta.title) + if wlbook.tree.find('//pe') is not None: + description += '
Ebook {title} zawiera przypisy opracowane specjalnie dla uczennic i uczniów {school}.'.format( + title=wlbook.meta.title, + school='szkoły podstawowej' if wlbook.meta.audience.startswith('SP') else 'liceum i technikum' + ) + description += '

\n' + abstract = wlbook.tree.find('.//abstrakt') if abstract is not None: - description = transform_abstrakt(abstract) + description += transform_abstrakt(abstract) description += description_add description += '

' description += ', '.join( '{}'.format( slugify(p.readable()), p.readable(), - ) + ) if p is not None else '' for p in wlbook.meta.authors ) + '
' description += '{}
'.format( @@ -44,32 +54,23 @@ class BasePublisher: '{}'.format( slugify(p), p, - ) + ) if p is not None else '' for p in wlbook.meta.epochs ) + ' ' description += 'Rodzaj: ' + ', '.join( '{}'.format( slugify(p), p, - ) + ) if p is not None else '' for p in wlbook.meta.kinds ) + ' ' description += 'Gatunek: ' + ', '.join( '{}'.format( slugify(p), p, - ) + ) if p is not None else '' for p in wlbook.meta.genres ) + '

' - # TODO: Move away from using audiences for this. - if wlbook.meta.audience in ('L', 'SP1', 'SP2', 'SP3', 'SP4'): - description += '

{} to lektura szkolna.'.format(wlbook.meta.title) - if wlbook.tree.find('//pe') is not None: - description += '
Ebook {title} zawiera przypisy opracowane specjalnie dla uczennic i uczniów {school}.'.format( - title=wlbook.meta.title, - school='szkoły podstawowej' if wlbook.meta.audience.startswith('SP') else 'liceum i technikum' - ) - description += '

' return description