"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xhtml2pdf/parser.py" between
xhtml2pdf-0.2.6.tar.gz and xhtml2pdf-0.2.7.tar.gz

About: xhtml2pdf is a HTML/CSS to PDF converter written in Python.

parser.py  (xhtml2pdf-0.2.6):parser.py  (xhtml2pdf-0.2.7)
skipping to change at line 73 skipping to change at line 73
pisaTagPDFPAGECOUNT, pisaTagPDFPAGECOUNT,
pisaTagPDFPAGENUMBER, pisaTagPDFPAGENUMBER,
pisaTagPDFSPACER, pisaTagPDFSPACER,
pisaTagPDFTEMPLATE, pisaTagPDFTEMPLATE,
pisaTagPDFTOC, pisaTagPDFTOC,
pisaTagSTYLE, pisaTagSTYLE,
pisaTagSUB, pisaTagSUB,
pisaTagSUP, pisaTagSUP,
pisaTagTITLE, pisaTagTITLE,
pisaTagUL, pisaTagUL,
pisaTagCANVAS,
# pisaTagINPUT, # pisaTagINPUT,
# pisaTagTEXTAREA, # pisaTagTEXTAREA,
# pisaTagSELECT, # pisaTagSELECT,
# pisaTagOPTION # pisaTagOPTION
) )
from xhtml2pdf.files import pisaTempFile from xhtml2pdf.files import pisaTempFile
from xhtml2pdf.util import getAlign, getBool, getBox, getColor, getPos, getSize, toList, transform_attrs from xhtml2pdf.util import getAlign, getBool, getBox, getColor, getPos, getSize, toList, transform_attrs
from xhtml2pdf.w3c import cssDOMElementInterface from xhtml2pdf.w3c import cssDOMElementInterface
from xhtml2pdf.xhtml2pdf_reportlab import PmlLeftPageBreak, PmlRightPageBreak from xhtml2pdf.xhtml2pdf_reportlab import PmlLeftPageBreak, PmlRightPageBreak
skipping to change at line 742 skipping to change at line 743
- Parse HTML and get miniDOM - Parse HTML and get miniDOM
- Extract CSS informations, add default CSS, parse CSS - Extract CSS informations, add default CSS, parse CSS
- Handle the document DOM itself and build reportlab story - Handle the document DOM itself and build reportlab story
- Return Context object - Return Context object
""" """
global CSSAttrCache global CSSAttrCache
CSSAttrCache = {} CSSAttrCache = {}
if xhtml: if xhtml:
log.warning("xhtml parameter will be removed on next release 0.2.8")
# TODO: XHTMLParser doesn't seem to exist... # TODO: XHTMLParser doesn't seem to exist...
parser = html5lib.XHTMLParser(tree=treebuilders.getTreeBuilder("dom")) parser = html5lib.XHTMLParser(tree=treebuilders.getTreeBuilder("dom"))
else: else:
parser = html5lib.HTMLParser(tree=treebuilders.getTreeBuilder("dom")) parser = html5lib.HTMLParser(tree=treebuilders.getTreeBuilder("dom"))
parser_kwargs = {} parser_kwargs = {}
if isinstance(src, str): if isinstance(src, str):
# If an encoding was provided, do not change it. # If an encoding was provided, do not change it.
if not encoding: if not encoding:
encoding = "utf-8" encoding = "utf-8"
src = src.encode(encoding) src = src.encode(encoding)
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)