"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/reportlab/platypus/paraparser.py" between
reportlab-3.5.65.tar.gz and reportlab-3.5.66.tar.gz

About: ReportLab generates high-quality dynamic PDF documents/charts in real-time & high volumes from any data source (commercial version also available). f: office t: PDF report "data graphics" charts

paraparser.py  (reportlab-3.5.65):paraparser.py  (reportlab-3.5.66)
skipping to change at line 54 skipping to change at line 54
except ValueError: except ValueError:
return ('relative',float(s)*unit) return ('relative',float(s)*unit)
else: else:
try: try:
return int(s)*unit return int(s)*unit
except ValueError: except ValueError:
return float(s)*unit return float(s)*unit
def _num(s, unit=1, allowRelative=True, def _num(s, unit=1, allowRelative=True,
_unit_map = {'i':inch,'in':inch,'pt':1,'cm':cm,'mm':mm,'pica':pica }, _unit_map = {'i':inch,'in':inch,'pt':1,'cm':cm,'mm':mm,'pica':pica },
_re_unit = re.compile('^\s*(.*)(i|in|cm|mm|pt|pica)\s*$'), _re_unit = re.compile(r'^\s*(.*)(i|in|cm|mm|pt|pica)\s*$'),
): ):
"""Convert a string like '10cm' to an int or float (in points). """Convert a string like '10cm' to an int or float (in points).
The default unit is point, but optionally you can use other The default unit is point, but optionally you can use other
default units like mm. default units like mm.
""" """
m = _re_unit.match(s) m = _re_unit.match(s)
if m: if m:
unit = _unit_map[m.group(2)] unit = _unit_map[m.group(2)]
s = m.group(1) s = m.group(1)
return _convnum(s,unit,allowRelative) return _convnum(s,unit,allowRelative)
skipping to change at line 2637 skipping to change at line 2637
self._push('em', italic=1) self._push('em', italic=1)
def end_em( self ): def end_em( self ):
self._pop('em') self._pop('em')
def _new_line(self,k): def _new_line(self,k):
frag = self._stack[-1] frag = self._stack[-1]
frag.us_lines = frag.us_lines + [( frag.us_lines = frag.us_lines + [(
self.nlines, self.nlines,
k, k,
getattr(frag,k+'Color',None), getattr(frag,k+'Color',self._defaultLineColors[k]),
getattr(frag,k+'Width',self._defaultLineWidths[k]), getattr(frag,k+'Width',self._defaultLineWidths[k]),
getattr(frag,k+'Offset',self._defaultLineOffsets[k]), getattr(frag,k+'Offset',self._defaultLineOffsets[k]),
frag.rise, frag.rise,
_lineRepeats[getattr(frag,k+'Kind','single')], _lineRepeats[getattr(frag,k+'Kind','single')],
getattr(frag,k+'Gap',self._defaultLineGaps[k]), getattr(frag,k+'Gap',self._defaultLineGaps[k]),
)] )]
self.nlines += 1 self.nlines += 1
#### underline #### underline
def start_u( self, attributes ): def start_u( self, attributes ):
skipping to change at line 2898 skipping to change at line 2898
else: else:
frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName) frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName)
frag.fontSize = style.fontSize frag.fontSize = style.fontSize
frag.textColor = style.textColor frag.textColor = style.textColor
frag.us_lines = [] frag.us_lines = []
self.nlinks = self.nlines = 0 self.nlinks = self.nlines = 0
self._defaultLineWidths = dict( self._defaultLineWidths = dict(
underline = getattr(style,'underlineWidth',' '), underline = getattr(style,'underlineWidth',' '),
strike = getattr(style,'strikeWidth',''), strike = getattr(style,'strikeWidth',''),
) )
self._defaultLineColors = dict(
underline = getattr(style,'underlineColor','
'),
strike = getattr(style,'strikeColor',''),
)
self._defaultLineOffsets = dict( self._defaultLineOffsets = dict(
underline = getattr(style,'underlineOffset', ''), underline = getattr(style,'underlineOffset', ''),
strike = getattr(style,'strikeOffset',''), strike = getattr(style,'strikeOffset',''),
) )
self._defaultLineGaps = dict( self._defaultLineGaps = dict(
underline = getattr(style,'underlineGap','') , underline = getattr(style,'underlineGap','') ,
strike = getattr(style,'strikeGap',''), strike = getattr(style,'strikeGap',''),
) )
self._defaultLinkUnderline = getattr(style,'linkUnderline',platypus_link _underline) self._defaultLinkUnderline = getattr(style,'linkUnderline',platypus_link _underline)
return frag return frag
 End of changes. 3 change blocks. 
2 lines changed or deleted 7 lines changed or added

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