From 3df78775bc9e2e4d861bc0eaa4deadd354dda518 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 7 Feb 2014 16:31:02 +0100 Subject: [PATCH 1/1] Fixes #3031: Sponsor info in PDF. --- librarian/__init__.py | 1 + librarian/dcparser.py | 5 ++++- librarian/pdf.py | 17 +++++++++++++++-- librarian/pdf/wl.cls | 9 +++++++++ librarian/pdf/wl2tex.xslt | 30 ++++++++++++++++++++++++++++++ librarian/res/sponsors/nck.png | Bin 0 -> 21975 bytes librarian/sponsor.py | 11 +++++++++++ setup.py | 3 ++- 8 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 librarian/res/sponsors/nck.png create mode 100644 librarian/sponsor.py diff --git a/librarian/__init__.py b/librarian/__init__.py index bf15d13..b257b79 100644 --- a/librarian/__init__.py +++ b/librarian/__init__.py @@ -72,6 +72,7 @@ XINS = XMLNamespace("http://www.w3.org/2001/XInclude") XHTMLNS = XMLNamespace("http://www.w3.org/1999/xhtml") NCXNS = XMLNamespace("http://www.daisy.org/z3986/2005/ncx/") OPFNS = XMLNamespace("http://www.idpf.org/2007/opf") +PLMETNS = XMLNamespace("http://dl.psnc.pl/schemas/plmet/") WLNS = EmptyNamespace() diff --git a/librarian/dcparser.py b/librarian/dcparser.py index ab1e714..12bb24f 100644 --- a/librarian/dcparser.py +++ b/librarian/dcparser.py @@ -10,7 +10,7 @@ import re from librarian.util import roman_to_int from librarian import (ValidationError, NoDublinCore, ParseError, DCNS, RDFNS, - XMLNS, WLURI, WLNS) + XMLNS, WLURI, WLNS, PLMETNS) import lxml.etree as etree # ElementTree API using libxml2 from lxml.etree import XMLSyntaxError @@ -242,6 +242,9 @@ class WorkInfo(object): Field( DCNS('identifier.url'), 'url', WLURI, strict=as_wluri_strict), Field( DCNS('rights.license'), 'license', required=False), Field( DCNS('rights'), 'license_description'), + + Field( PLMETNS('digitisationSponsor'), 'sponsors', multiple=True, default=[]), + Field( WLNS('digitisationSponsorNote'), 'sponsor_note', required=False), ) @classmethod diff --git a/librarian/pdf.py b/librarian/pdf.py index 2154985..af258fc 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -28,6 +28,7 @@ from librarian.parser import WLDocument from librarian import ParseError, DCNS, get_resource, OutputFile from librarian import functions from librarian.cover import DefaultEbookCover +from .sponsor import sponsor_logo functions.reg_substitute_entities() @@ -247,11 +248,23 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None, style_filename = get_stylesheet("wl2tex") style = etree.parse(style_filename) - texml = document.transform(style) - # TeXML -> LaTeX temp = mkdtemp('-wl2pdf') + for sponsor in book_info.sponsors: + ins = etree.Element("data-sponsor", name=sponsor) + logo = sponsor_logo(sponsor) + if logo: + fname = 'sponsor-%s' % os.path.basename(logo) + shutil.copy(logo, os.path.join(temp, fname)) + ins.set('src', fname) + root.insert(0, ins) + + if book_info.sponsor_note: + root.set("sponsor-note", book_info.sponsor_note) + + texml = document.transform(style) + if cover: with open(os.path.join(temp, 'cover.png'), 'w') as f: bound_cover.save(f) diff --git a/librarian/pdf/wl.cls b/librarian/pdf/wl.cls index a9ace8e..8907b08 100644 --- a/librarian/pdf/wl.cls +++ b/librarian/pdf/wl.cls @@ -126,6 +126,8 @@ Letters={SmallCaps,UppercaseSmallCaps} \pagestyle{plain} \usepackage{fancyhdr} +\usepackage{marginnote} + \makeatletter @@ -238,6 +240,13 @@ Letters={SmallCaps,UppercaseSmallCaps} \color{theme} \noindent \rule{\linewidth}{0.4pt} + \ifdefined\sponsors + \marginnote{% + \centering% + \sponsors% + } + \fi + \rightsinfo \vspace{.6em} diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt index ca948da..c120fb0 100644 --- a/librarian/pdf/wl2tex.xslt +++ b/librarian/pdf/wl2tex.xslt @@ -110,6 +110,24 @@ \def\funders{Publikację ufundowali i ufundowały: .} + + + \def\sponsors{ + \scriptsize + + + + + + Sfinansowano ze~środków: + + + + \vspace{1em} + + + } + @@ -404,6 +422,18 @@ + + + + + \includegraphics[height=0.25\textwidth,width=0.25\textwidth,keepaspectratio]{} + + + + + + + diff --git a/librarian/res/sponsors/nck.png b/librarian/res/sponsors/nck.png new file mode 100644 index 0000000000000000000000000000000000000000..e53f19c290853085700c27f9475665f9ccf80fd5 GIT binary patch literal 21975 zcmdSAWl&sS^esrx#vOvY1SdE&?(S~E-Q9z`2e;tv?(Ul4?(XjJI=}zae3_d0Fdtsk zE2^ux_ndp~vAy=%Yo88RkP}CQ!-WF_14ERQ5K#gH`$7l$!~wuTcQUZYKo?+;W`eSU zU|_Ye@NWiCpzAMAO5#FbRa5xKpbKIn2_;!DFi%P_u%AI-U@xFsKaaq`T$sSXPJV!a zai@ZTVcTc6DFQ(S(1z0DB4D5Y{(g5BCxY(4+Dm9Ufq^lQ{rh}zFXVRx15;&?6cJQ$ zUpdc$amN^Z9cJu&+@K{Xm@SmBBmK+sS5*K~^ekct1+&JeH$Vjw<%=k)5<~8z+)?Kv zme$yNH%onUE4f=rC-~6k<$K*U?{-~UR#w(@$K@{{@j{Y#iO(_>6-aV4K?zdSAab;D zV)A%^5L&nhN`eF=Nw^3pK$1KlPUOEbP?i76Kvn)L16BF23{>U+(8m?JrKF@HBG?8g zRCzN72PuL@Ipem=^nQ<6I@A^gonQ%;6m)^{`|zu`n&!1EZTXdJC@ZEn@9dOi$OqJ% z%-MKvw7WmAyb!oe>y_l;lO}f1Y%ZnyT^tr-W0`EU+qa&WCJ_umc_D2q)m9hOD7++y zpqyY=FCQM#YoBi_*d#Xm&A&(^!mi`)FO!p0B}Ga5w#Y(+6>6e+ zxNE*GSJ+=@%km2Cs1?FYw#rF3O-(*b&CZXQt}XZV-QZWHDksemU9_{cVF%MxT`k;O zDP~lMx;Xv}c+*A`)TpA>2%3)cD`QbrY?Z??Z<>FwuzcO4v*(nx*HCc*OsE7y@T=9^ zBs%PI6_nao?JZHMp(07cTJsSrWA=`-P%M(rYbVu^H0B#ak7A((g%Ah1rHr3Ae~-~= zpR2?F@bb0z=3nguK0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fV~)XY(REd zjBz9s>*%zhb+s#iu!Qvs=;ft(tUAi|A?5)Euh`XEizHsP>ryvRqAry8ZFPbq=bD}r z8f0q(Gnk-X6)a8{Yx5vHpsAm+t3&u4pb_@tk~yd~y1ag_nSB3#Ze`>pIw>=MT0_NVMC0b0u(V=4dMX>X_lwB2v@yeB69*>Qo5-DyxsdioL)7Wajp3aSgL}b!kibq~#szks7 zY$E(j(qbb5Dlg7$vcbO7pw^i5;>Ym2bzv=I1cJDKZ~*v)u7I}=`9uy^t_U1@8>pWp zoW_&Jw8kI2spI3bzo@&kvuVo4GFIn1d2xQW*Sge`UOG6~d$&08NhbVE|&lIn>m4% rqyNiVQT{J?`TyGr()0ecONy*94jIdWq;X)KDuu4Lfz~&T*Af2%rf*2T literal 0 HcmV?d00001 diff --git a/librarian/sponsor.py b/librarian/sponsor.py new file mode 100644 index 0000000..15d9107 --- /dev/null +++ b/librarian/sponsor.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from librarian import get_resource + +def sponsor_logo(name): + return { + 'Narodowe Centrum Kultury': get_resource('res/sponsors/nck.png') + }.get(name.strip()) diff --git a/setup.py b/setup.py index 7bcbbc2..732f145 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,8 @@ setup( maintainer_email='radoslaw.czajka@nowoczesnapolska.org.pl', url='http://github.com/fnp/librarian', packages=['librarian'], - package_data={'librarian': ['xslt/*.xslt', 'epub/*', 'mobi/*', 'pdf/*', 'fb2/*', 'fonts/*', 'res/*'] + + package_data={'librarian': ['xslt/*.xslt', 'epub/*', 'mobi/*', 'pdf/*', 'fb2/*', 'fonts/*'] + + whole_tree(os.path.join(os.path.dirname(__file__), 'librarian'), 'res') + whole_tree(os.path.join(os.path.dirname(__file__), 'librarian'), 'font-optimizer')}, include_package_data=True, install_requires=[ -- 2.20.1