ó LzñWc@s€dZddlZddlZddlZddlmZmZddlmZmZddlm Z de fd„ƒYZ dS(sï pdfLaTeX support for Rubber. When this module loaded with the otion 'dvi', the document is compiled to DVI using pdfTeX. The module optimizes the pdflatex calls by setting -draftmode and apply a last call to build the final PDF output. iÿÿÿÿN(tPopentPIPE(t_tmsg(t TexModuletModulecBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCsS||_d|_d|_|jdƒ|jƒrCt|j_n t|j_dS(NtpdflatextpdfTeXtpdf(tdoctprogramtenginet set_formatt_draft_is_supportedtTruet draft_supporttFalse(tselfR tdict((sB/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/pdftex.pyt__init__s     cCs2tjddƒ}d|kr"tS|jƒdkS(NtDBLATEX_PDFTEX_OPTIONSts -draftmodes1.40(tostgetenvRt _get_version(Rtopts((sB/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/pdftex.pyR %s cCs'|jjsdS|jjjdƒdS(Ns -draftmode(R RRtappend(R((sB/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/pdftex.pyt pre_compile,s cCsC|jj s|jjrdS|jjjdƒ|jjƒ}|S(Ns -draftmode(R Rt draft_onlyRtremovetcompile(Rtrc((sB/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/pdftex.pyt last_compile3s cCs[tddtdtƒ}|jƒd}tjd|tjƒ}|sJdS|jdƒSdS( sA Parse something like: pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6) kpathsea version 3.5.6 Copyright 2007 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). Kpathsea is copyright 2007 Karl Berry and Olaf Weber. ... and return '1.40' spdflatex -versiontshelltstdoutispdfTeX.*3.14[^-]*-(\d*.\d*)RiN(RRRt communicatetretsearchtMtgroup(Rtptdatatm((sB/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/pdftex.pyR>s (t__name__t __module__RR RR R(((sB/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/pdftex.pyRs     ( t__doc__RR$t subprocessRRRRtpluginsRR(((sB/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/pdftex.pyt s