Hello community, here is the log from the commit of package python-reportlab for openSUSE:Factory checked in at 2020-10-29 09:46:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-reportlab (Old) and /work/SRC/openSUSE:Factory/.python-reportlab.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-reportlab" Thu Oct 29 09:46:20 2020 rev:27 rq:838445 version:3.5.51 Changes: -------- --- /work/SRC/openSUSE:Factory/python-reportlab/python-reportlab.changes 2020-08-01 12:30:16.490406075 +0200 +++ /work/SRC/openSUSE:Factory/.python-reportlab.new.3463/python-reportlab.changes 2020-10-29 09:46:24.004060587 +0100 @@ -1,0 +2,28 @@ +Thu Sep 24 17:54:30 UTC 2020 - Hans-Peter Jansen <h...@urpla.net> + +- Update to 3.5.51 + * fix malloc(0) issue in \_rl_accel.c \_fp_str + thanks to Hans-Peter Jansen <h...@urpla.net> @ openSUSE +- remove fix-rl_accel-crash.patch + +------------------------------------------------------------------- +Wed Sep 23 11:09:33 UTC 2020 - Hans-Peter Jansen <h...@urpla.net> + +- add fix-rl_accel-crash.patch to fix a crash in rl_accel. + +------------------------------------------------------------------- +Tue Sep 22 13:35:04 UTC 2020 - Hans-Peter Jansen <h...@urpla.net> + +- Update to 3.5.50 + * Add BM ExtGState option (suggestion by tjj021 @ github + * Fix memory leak in _renderPM.c +- Update to 3.5.49 + * ViewerPreferencesPDFDictionary add /Duplex as possibility + * Doctemplate add support for all ViewerPreferencesPDFDictionary keys + * fix bugs in USPS_4State; Barcode inherits from Flowable and object. +- Update to 3.5.48 + * bug fix for balanced column special case unsplittable half column +- Update to 3.5.47 + * try to limit table style cell ranges + +------------------------------------------------------------------- Old: ---- reportlab-3.5.46.tar.gz New: ---- reportlab-3.5.51.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-reportlab.spec ++++++ --- /var/tmp/diff_new_pack.9SvHOJ/_old 2020-10-29 09:46:25.152061672 +0100 +++ /var/tmp/diff_new_pack.9SvHOJ/_new 2020-10-29 09:46:25.156061675 +0100 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-reportlab -Version: 3.5.46 +Version: 3.5.51 Release: 0 Summary: The Reportlab Toolkit License: BSD-3-Clause @@ -56,7 +56,7 @@ %build export CFLAGS="%{optflags}" -%python_build +%python_build --no-download-t1-files PYTHONPATH=$(readlink -f build/lib.linux-*/) \ python3 docs/genAll.py ++++++ reportlab-3.5.46.tar.gz -> reportlab-3.5.51.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/.travis.yml new/reportlab-3.5.51/.travis.yml --- old/reportlab-3.5.46/.travis.yml 2020-02-26 15:58:03.000000000 +0100 +++ new/reportlab-3.5.51/.travis.yml 2020-09-18 15:27:00.000000000 +0200 @@ -16,11 +16,9 @@ - CITOOLS_USER=rl-wheelbuilder - RLCACHE=manylinux/reportlab - secure: ZrIej0neeQWKd7svbNEdaKyAxWvGCjpEI2QhjEZ8+6T2Ggp0N1nHSw8768OxAGZhVDwi0kkMTj+i2Fqb5i/p60tveFn3rYk8KG27KjZo/eErAP8T46tTTZBGCXN4m9h62IyhwQQSqGdUGXbEELmCqWTANYNyorCA+fSXwJYa74ly7BRlUke6eg3XAllw83lECDBqSehafJb5QwNYJHYo63Ak8f0T3a/m4eGzQtGTK2WluZ9/0QiO4iutNGztYbHjtgJFoUBzUPtkW4z1x9RJtEAIms9U8c6vB3efU15mrXlt8yH2ANtybbn0bLidT6rem+lqB8LvLh9Hc5cRAtRmeLYjVQRAbXxKg+ZCaf9R1XNn6O6C49YPIf2Z76ZW6LkqCyEwNPCYj0BDa8tbg9zGLO8P7Qxf+x8uVqpSo9nmvgfLWRQ0Vb3tKTnic3CC+p3bGaFocousmMilpr891w01wsdT9utjvF8U5JCK9Valo6FPhUum66rWVyzqBWP3kKPWa4OirRaJpdptm02ZcbQl4ZOIGlqt+GqN28CZO5xaUL4h9plM57h7bOydKVK4eP0j+ICdPWkQh1+cfEVZLZJMYBsMwXyKAPtruLi1HM2X/yPsvLjLZR9BA9d9bvJ2v9zJe9v5aOwOLfJXgdDlXfXtkzLa0dCDaseG3U7+Tm8oElg= - # travis encrypt -r MrBitBucket/reportlab-mirror CITOOLS_PASSWORD="**********************" --add with extra bash quoting -language: python -# Default Python version is usually 3.5 -python: 3.5 -sudo: required + # travis encrypt -r MrBitBucket/reportlab-mirror CITOOLS_PASSWORD="****\\;*************\\#*****" --add with extra bash quoting +language: shell +os: linux dist: trusty services: docker @@ -31,10 +29,7 @@ - live_err...@reportlab.com on_success: always on_failure: always -matrix: - exclude: - # Exclude the default Python 3.5 build - - python: 3.5 +jobs: include: - os: linux env: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/CHANGES.md new/reportlab-3.5.51/CHANGES.md --- old/reportlab-3.5.46/CHANGES.md 2020-07-22 09:53:33.000000000 +0200 +++ new/reportlab-3.5.51/CHANGES.md 2020-09-24 15:27:24.000000000 +0200 @@ -11,6 +11,29 @@ The contributors lists are in no order and apologies to those accidentally not mentioned. If we missed you, please let us know! +RELEASE 3.5.51 24/09/2020 +--------------------------- + * fix malloc(0) issue in \_rl_accel.c \_fp_str thanks to Hans-Peter Jansen <h...@urpla.net> @ openSUSE + +RELEASE 3.5.50 18/09/2020 +--------------------------- + * Add BM ExtGState option (suggestion by tjj021 @ github + * Fix memory leak in \_renderPM.c + +RELEASE 3.5.49 02/09/2020 +--------------------------- + * ViewerPreferencesPDFDictionary add /Duplex as possibility + * Doctemplate add support for all ViewerPreferencesPDFDictionary keys + * fix bugs in USPS_4State; Barcode inherits from Flowable and object. + +RELEASE 3.5.48 18/08/2020 +--------------------------- + * bug fix for balanced column special case unsplittable half column + +RELEASE 3.5.47 7/08/2020 +--------------------------- + * try to limit table style cell ranges + RELEASE 3.5.46 22/07/2020 --------------------------- * fix style-data mismatch in LinePlot found by Anshika Sahay diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/PKG-INFO new/reportlab-3.5.51/PKG-INFO --- old/reportlab-3.5.46/PKG-INFO 2020-07-22 09:54:00.000000000 +0200 +++ new/reportlab-3.5.51/PKG-INFO 2020-09-24 15:27:52.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: reportlab -Version: 3.5.46 +Version: 3.5.51 Summary: The Reportlab Toolkit Home-page: http://www.reportlab.com/ Author: Andy Robinson, Robin Becker, the ReportLab team and the community diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/setup.py new/reportlab-3.5.51/setup.py --- old/reportlab-3.5.46/setup.py 2019-10-01 17:38:11.000000000 +0200 +++ new/reportlab-3.5.51/setup.py 2020-09-18 15:27:00.000000000 +0200 @@ -1,6 +1,6 @@ #Copyright ReportLab Europe Ltd. 2000-2017 #see license.txt for license details -__version__='3.5.25' +__version__='3.5.48' import os, sys, glob, shutil, re def specialOption(n): v = False @@ -16,6 +16,7 @@ # if used on command line the config values are not used dlt1 = not specialOption('--no-download-t1-files') usla = specialOption('--use-system-libart') +mdbg = specialOption('--memory-debug') try: import configparser @@ -147,6 +148,8 @@ if not usla: #not set on command line so try for config value usla = config('OPTIONS','use-system-libart','0').lower() in ('1','true','yes') +if not mdbg: + mdbg = config('OPTIONS','memory-debug','0').lower() in ('1','true','yes') #this code from /FBot's PIL setup.py def aDir(P, d, x=None): @@ -386,6 +389,8 @@ debug_link_args=['/DEBUG'] if debug>1: debug_macros.extend([('RL_DEBUG',debug), ('ROBIN_DEBUG',None)]) + if mdbg: + debug_macros.extend([('MEMORY_DEBUG',None)]) SPECIAL_PACKAGE_DATA = {} RL_ACCEL = _find_rl_ccode('rl_accel','_rl_accel.c') @@ -497,7 +502,7 @@ if m: D[m.group(1).lower()] = m.group(2) if len(D)==3: break - return (sys.platform == 'win32' and '\\"%s\\"' or '"%s"') % '.'.join(map(lambda k,D=D: D.get(k,'?'),K)) + return '.'.join(map(lambda k,D=D: D.get(k,'?'),K)) LIBART_VERSION = libart_version() infoline('will use package libart %s' % LIBART_VERSION.replace('"','')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/__init__.py new/reportlab-3.5.51/src/reportlab/__init__.py --- old/reportlab-3.5.46/src/reportlab/__init__.py 2020-07-22 09:53:33.000000000 +0200 +++ new/reportlab-3.5.51/src/reportlab/__init__.py 2020-09-24 15:27:24.000000000 +0200 @@ -1,9 +1,9 @@ #Copyright ReportLab Europe Ltd. 2000-2018 #see license.txt for license details __doc__="""The Reportlab PDF generation library.""" -Version = "3.5.46" +Version = "3.5.51" __version__=Version -__date__='20200722' +__date__='20200924' import sys, os diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/graphics/barcode/common.py new/reportlab-3.5.51/src/reportlab/graphics/barcode/common.py --- old/reportlab-3.5.46/src/reportlab/graphics/barcode/common.py 2019-10-01 17:38:11.000000000 +0200 +++ new/reportlab-3.5.51/src/reportlab/graphics/barcode/common.py 2020-09-02 14:34:06.000000000 +0200 @@ -35,7 +35,7 @@ from reportlab.lib.utils import ascii_uppercase, ascii_lowercase from string import digits as string_digits -class Barcode(Flowable): +class Barcode(Flowable,object): """Abstract Base for barcodes. Includes implementations of some methods suitable for the more primitive barcode types""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/graphics/barcode/usps4s.py new/reportlab-3.5.51/src/reportlab/graphics/barcode/usps4s.py --- old/reportlab-3.5.46/src/reportlab/graphics/barcode/usps4s.py 2020-01-22 15:40:54.000000000 +0100 +++ new/reportlab-3.5.51/src/reportlab/graphics/barcode/usps4s.py 2020-09-02 14:34:06.000000000 +0200 @@ -22,28 +22,56 @@ _heightSize = 1 _fontSize = 11 _humanReadable = 0 - tops = dict( - F = (0.067,0.115), - T = (0.021,0.040), - A = (0.067,0.115), - D = (0.021,0.040), - ) - bottoms = dict( - F = (-0.067,-0.115), - D = (-0.067,-0.115), - T = (-0.021,-0.040), - A = (-0.021,-0.040), - ) - dimensions = dict( - width = (0.015, 0.025), - pitch = (0.0416,0.050), - hcz = (0.125,0.125), - vcz = (0.040,0.040), - ) + if True: + tops = dict( + F = (0.0625,0.0825), + T = (0.0195,0.0285), + A = (0.0625,0.0825), + D = (0.0195,0.0285), + ) + bottoms = dict( + F = (-0.0625,-0.0825), + T = (-0.0195,-0.0285), + D = (-0.0625,-0.0825), + A = (-0.0195,-0.0285), + ) + dimensions = dict( + width = (0.015, 0.025), + pitch = (0.0416, 0.050), + hcz = (0.125,0.125), + vcz = (0.028,0.028), + ) + else: + tops = dict( + F = (0.067,0.115), + T = (0.021,0.040), + A = (0.067,0.115), + D = (0.021,0.040), + ) + bottoms = dict( + F = (-0.067,-0.115), + D = (-0.067,-0.115), + T = (-0.021,-0.040), + A = (-0.021,-0.040), + ) + dimensions = dict( + width = (0.015, 0.025), + pitch = (0.0416,0.050), + hcz = (0.125,0.125), + vcz = (0.040,0.040), + ) def __init__(self,value='01234567094987654321',routing='',**kwd): self._init() value = str(value) if isinstance(value,int) else asNative(value) + if not routing: + #legal values for combined tracking + routing + if len(value) in (20,25,29,31): + value, routing = value[:20], value[20:] + else: + raise ValueError('value+routing length must be 20, 25, 29 or 31 digits not %d' % len(value)) + elif len(routing) not in (5,9,11): + raise ValueError('routing length must be 5, 9 or 11 digits not %d' % len(routing)) self._tracking = value self._routing = routing self._setKeywords(**kwd) @@ -71,7 +99,7 @@ def widthSize(self,value): self._sized = None - self._widthSize = value + self._widthSize = min(max(0,value),1) widthSize = property(lambda self: self._widthSize,widthSize) def heightSize(self,value): @@ -241,9 +269,42 @@ _bits2bars = 'T','D','A','F' horizontalClearZone = property(lambda self: self.scale('hcz',self.dimensions,self.widthScale)) verticalClearZone = property(lambda self: self.scale('vcz',self.dimensions,self.heightScale)) - pitch = property(lambda self: self.scale('pitch',self.dimensions,self.widthScale)) - barWidth = property(lambda self: self.scale('width',self.dimensions,self.widthScale)) - barHeight = property(lambda self: self.scale('F',self.tops,self.heightScale) - self.scale('F',self.bottoms,self.heightScale)) + + @property + def barWidth(self): + if '_barWidth' in self.__dict__: + return self.__dict__['_barWidth'] + return self.scale('width',self.dimensions,self.widthScale) + + @barWidth.setter + def barWidth(self,value): + n, x = self.dimensions['width'] + self.__dict__['_barWidth'] = 72*min(max(value/72.0,n),x) + + @property + def pitch(self): + if '_pitch' in self.__dict__: + return self.__dict__['_pitch'] + return self.scale('pitch',self.dimensions,self.widthScale) + + @pitch.setter + def pitch(self,value): + n, x = self.dimensions['pitch'] + self.__dict__['_pitch'] = 72*min(max(value/72.0,n),x) + + @property + def barHeight(self): + if '_barHeight' in self.__dict__: + return self.__dict__['_barHeight'] + return self.scale('F',self.tops,self.heightScale) - self.scale('F',self.bottoms,self.heightScale) + + @barHeight.setter + def barHeight(self,value): + n = self.tops['F'][0] - self.bottoms['F'][0] + x = self.tops['F'][1] - self.bottoms['F'][1] + value = self.__dict__['_barHeight'] = 72*min(max(value/72.0,n),x) + self.heightSize = (value - n)/(x-n) + widthScale = property(lambda self: min(1,max(0,self.widthSize))) heightScale = property(lambda self: min(1,max(0,self.heightSize))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/graphics/barcode/widgets.py new/reportlab-3.5.51/src/reportlab/graphics/barcode/widgets.py --- old/reportlab-3.5.46/src/reportlab/graphics/barcode/widgets.py 2019-10-01 17:38:11.000000000 +0200 +++ new/reportlab-3.5.51/src/reportlab/graphics/barcode/widgets.py 2020-09-02 14:34:06.000000000 +0200 @@ -61,8 +61,8 @@ _BCC = None def __init__(self,_value='',**kw): PlotArea.__init__(self) - del self.__dict__['width'] - del self.__dict__['height'] + if 'width' in self.__dict__: del self.__dict__['width'] + if 'height' in self.__dict__: del self.__dict__['height'] self.x = self.y = 0 kw.setdefault('value',_value) self._BCC.__init__(self,**kw) @@ -94,7 +94,8 @@ code = 'from %s import %s' % (mod,codeName) rl_exec(code,ns) ns['_BarcodeWidget'] = _BarcodeWidget - code = '''class %(name)s(_BarcodeWidget,%(codeName)s): + ns['doc'] = ("\n\t'''%s'''" % doc) if doc else '' + code = '''class %(name)s(_BarcodeWidget,%(codeName)s):%(doc)s \t_BCC = %(codeName)s \tcodeName = %(codeName)r \tdef __init__(self,**kw):%(_pre_init)s @@ -102,7 +103,6 @@ rl_exec(code,ns) Klass = ns[name] if attrMap: Klass._attrMap = attrMap - if doc: Klass.__doc__ = doc for k, v in kwds.items(): setattr(Klass,k,v) return Klass @@ -304,6 +304,9 @@ tracking = AttrMapValue(isString, desc='tracking data'), routing = AttrMapValue(isString, desc='routing data'), humanReadable = AttrMapValue(isBoolean, desc='if human readable'), + barWidth = AttrMapValue(isNumber, desc='barWidth'), + barHeight = AttrMapValue(isNumber, desc='barHeight'), + pitch = AttrMapValue(isNumber, desc='pitch'), ), 'reportlab.graphics.barcode.usps4s', '01234567094987654321', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/lib/attrmap.py new/reportlab-3.5.51/src/reportlab/lib/attrmap.py --- old/reportlab-3.5.46/src/reportlab/lib/attrmap.py 2019-10-01 17:38:11.000000000 +0200 +++ new/reportlab-3.5.51/src/reportlab/lib/attrmap.py 2020-09-02 14:34:06.000000000 +0200 @@ -30,7 +30,7 @@ ''' from reportlab.lib.validators import isAnything, DerivedValue from reportlab.lib.utils import isSeq -from reportlab import rl_config, ascii +from reportlab import rl_config, ascii, isPy3 class CallableValue: '''a class to allow callable initial values''' @@ -113,7 +113,14 @@ raise AttributeError("Illegal assignment of '%s' to '%s' in class %s" % (value, name, obj.__class__.__name__)) except KeyError: raise AttributeError("Illegal attribute '%s' in class %s" % (name, obj.__class__.__name__)) - obj.__dict__[name] = value + prop = getattr(obj.__class__,name,None) + if isinstance(prop,property): + try: + prop.__set__(obj,value) + except AttributeError: + pass + else: + obj.__dict__[name] = value def _privateAttrMap(obj,ret=0): '''clone obj._attrMap if required''' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/pdfbase/pdfdoc.py new/reportlab-3.5.51/src/reportlab/pdfbase/pdfdoc.py --- old/reportlab-3.5.46/src/reportlab/pdfbase/pdfdoc.py 2019-10-01 17:38:11.000000000 +0200 +++ new/reportlab-3.5.51/src/reportlab/pdfbase/pdfdoc.py 2020-09-02 14:34:06.000000000 +0200 @@ -742,6 +742,7 @@ PrintArea=checkPDFNames(*'MediaBox CropBox BleedBox TrimBox ArtBox'.split()), PrintClip=checkPDFNames(*'MediaBox CropBox BleedBox TrimBox ArtBox'.split()), PrintScaling=checkPDFNames(*'None AppDefault'.split()), + Duplex=checkPDFNames(*'Simplex DuplexFlipShortEdge DuplexFlipLongEdge'.split()), ) # stream filters are objects to support round trip and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/pdfgen/canvas.py new/reportlab-3.5.51/src/reportlab/pdfgen/canvas.py --- old/reportlab-3.5.46/src/reportlab/pdfgen/canvas.py 2020-02-26 15:58:03.000000000 +0100 +++ new/reportlab-3.5.51/src/reportlab/pdfgen/canvas.py 2020-09-18 15:27:00.000000000 +0200 @@ -141,7 +141,29 @@ OP=False, op=False, OPM=0, + BM='Normal', ) + allowed = dict( + BM = { + 'Normal', 'Multiply', 'Screen', 'Overlay', + 'Darken', 'Lighten', 'ColorDodge', 'ColorBurn', + 'HardLight', 'SoftLight', 'Difference', 'Exclusion', + 'Hue', 'Saturation', 'Color', 'Luminosity', + }, + ) + pdfNameValues = {'BM'} + + @staticmethod + def _boolTransform(v): + return str(v).lower() + + @staticmethod + def _identityTransform(v): + return v + + @staticmethod + def _pdfNameTransform(v): + return '/'+v def __init__(self): self._d = {} @@ -149,12 +171,19 @@ def set(self,canv,a,v): d = self.defaults[a] - isbool = isinstance(d,bool) - if isbool: v=bool(v) + if isinstance(d,bool): + v=bool(v) + vTransform = self._boolTransform + elif a in self.pdfNameValues: + if v not in self.allowed[a]: + raise ValueError('ExtGstate[%r] = %r not in allowed values %r' % ( + a,v,self.allowed[a])) + vTransform = self._pdfNameTransform + else: + vTransform = self._identityTransform if v!=self._d.get(a,d) or (a=='op' and self.getValue('OP')!=d): self._d[a] = v - if isbool: v=str(v).lower() - t = a,v + t = a,vTransform(v) if t in self._c: name = self._c[t] else: @@ -580,6 +609,9 @@ def _setOverprintMask(self,v): self._extgstate.set(self,'OPM',v and 1 or 0) + def setBlendMode(self, v): + self._extgstate.set(self,'BM',v) + def _getCmShift(self): cM = self._cropMarks if cM: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/platypus/doctemplate.py new/reportlab-3.5.51/src/reportlab/platypus/doctemplate.py --- old/reportlab-3.5.46/src/reportlab/platypus/doctemplate.py 2019-10-24 17:16:28.000000000 +0200 +++ new/reportlab-3.5.51/src/reportlab/platypus/doctemplate.py 2020-09-02 14:34:06.000000000 +0200 @@ -506,6 +506,19 @@ 'trimBox': None, 'bleedBox': None, 'keepTogetherClass': KeepTogether, + 'hideToolbar': None, + 'hideMenubar': None, + 'hideWindowUI': None, + 'fitWindow': None, + 'centerWindow': None, + 'nonFullScreenPageMode': None, + 'direction': None, + 'viewArea': None, + 'viewClip': None, + 'printArea': None, + 'printClip': None, + 'printScaling': None, + 'duplex': None, } _invalidInitArgs = () _firstPageTemplateIndex = 0 @@ -993,8 +1006,15 @@ canv.setCreator(self.creator) canv.setProducer(self.producer) canv.setKeywords(self.keywords) - if self.displayDocTitle is not None: - canv.setViewerPreference('DisplayDocTitle',['false','true'][self.displayDocTitle]) + from reportlab.pdfbase.pdfdoc import ( + ViewerPreferencesPDFDictionary as VPD, checkPDFBoolean as cPDFB, + ) + for k,vf in VPD.validate.items(): + v = getattr(self,k[0].lower()+k[1:],None) + if v is not None: + if vf is cPDFB: + v = ['false','true'][v] #convert to pdf form of boolean + canv.setViewerPreference(k,v) if self._onPage: canv.setPageCallBack(self._onPage) @@ -1217,9 +1237,9 @@ raise ValueError('bad lifetime %r not in %r'%(lifetime,self._allowedLifetimes)) exec(stmt, NS) except: - for k in NS.keys(): - if k not in K0: - del NS[k] + K1 = [k for k in NS if k not in K0] #the added keys we need to delete + for k in K1: + del NS[k] annotateException('\ndocExec %s lifetime=%r failed!\n' % (stmt,lifetime)) self._addVars([k for k in NS.keys() if k not in K0],lifetime) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/platypus/flowables.py new/reportlab-3.5.51/src/reportlab/platypus/flowables.py --- old/reportlab-3.5.46/src/reportlab/platypus/flowables.py 2020-03-04 14:25:07.000000000 +0100 +++ new/reportlab-3.5.51/src/reportlab/platypus/flowables.py 2020-08-18 14:00:34.000000000 +0200 @@ -1614,6 +1614,9 @@ assert not C2, "unexpected non-empty C2" W1, H1, C, C1 = splitFunc(H, endSlack) _fres.clear() + if C[0]==[] and C[1]==[] and C1: + #no split situation + C, C1 = [C1,C[1]], C[0] x1 = frame._x1 y1 = frame._y1 @@ -1648,7 +1651,8 @@ xbg = bg = BGs[-1] if BGs else None class TAction(ActionFlowable): - def __init__(self,bgs=[],F=[],f=None): + '''a special Action flowable that sets stuff on the doc template T''' + def __init__(self, bgs=[],F=[],f=None): Flowable.__init__(self) self.bgs = bgs self.F = F @@ -1714,9 +1718,11 @@ if doVLines: G.extend(vLines) sa = self.getSpaceAfter() for i in xrange(nCols): - Ci = KeepInFrame(W1,H1,C[i],mode='shrink') - sa = max(sa,Ci.getSpaceAfter()) - G.append(Ci) + Ci = C[i] + if Ci: + Ci = KeepInFrame(W1,H1,Ci,mode='shrink') + sa = max(sa,Ci.getSpaceAfter()) + G.append(Ci) if i!=nCols-1: G.append(FrameBreak) G.append(TAction(BGs,oldFrames,frame)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab/platypus/tables.py new/reportlab-3.5.51/src/reportlab/platypus/tables.py --- old/reportlab-3.5.46/src/reportlab/platypus/tables.py 2020-03-17 13:45:46.000000000 +0100 +++ new/reportlab-3.5.51/src/reportlab/platypus/tables.py 2020-08-07 09:31:22.000000000 +0200 @@ -1035,6 +1035,14 @@ if not hasattr(self,a) and hasattr(tblstyle,a): setattr(self,a,getattr(tblstyle,a)) + def normCellRange(self, sc, ec, sr, er): + '''ensure cell range ends are with the table bounds''' + if sc < 0: sc = sc + self._ncols + if ec < 0: ec = ec + self._ncols + if sr < 0: sr = sr + self._nrows + if er < 0: er = er + self._nrows + return max(0,sc), min(self._ncols-1,ec), max(0,sr), min(self._nrows-1,er) + def _addCommand(self,cmd): if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'): self._bkgrndcmds.append(cmd) @@ -1088,12 +1096,10 @@ if sr in ('splitfirst','splitlast'): self._srflcmds.append(cmd) else: - if sc < 0: sc = sc + self._ncols - if ec < 0: ec = ec + self._ncols - if sr < 0: sr = sr + self._nrows - if er < 0: er = er + self._nrows + sc, ec, sr, er = self.normCellRange(sc,ec,sr,er) + ec += 1 for i in xrange(sr, er+1): - for j in xrange(sc, ec+1): + for j in xrange(sc, ec): _setCellStyle(self._cellStyles, i, j, op, values) def _drawLines(self): @@ -1101,10 +1107,6 @@ self.canv.saveState() for op, (sc,sr), (ec,er), weight, color, cap, dash, join, count, space in self._linecmds: if isinstance(sr,strTypes) and sr.startswith('split'): continue - if sc < 0: sc = sc + self._ncols - if ec < 0: ec = ec + self._ncols - if sr < 0: sr = sr + self._nrows - if er < 0: er = er + self._nrows if cap!=None and ccap!=cap: self.canv.setLineCap(cap) ccap = cap @@ -1118,6 +1120,7 @@ if join is not None and cjoin!=join: self.canv.setLineJoin(join) cjoin = join + sc, ec, sr, er = self.normCellRange(sc,ec,sr,er) getattr(self,_LineOpMap.get(op, '_drawUnknown' ))( (sc, sr), (ec, er), weight, color, count, space) self.canv.restoreState() self._curcolor = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/reportlab.egg-info/PKG-INFO new/reportlab-3.5.51/src/reportlab.egg-info/PKG-INFO --- old/reportlab-3.5.46/src/reportlab.egg-info/PKG-INFO 2020-07-22 09:53:59.000000000 +0200 +++ new/reportlab-3.5.51/src/reportlab.egg-info/PKG-INFO 2020-09-24 15:27:52.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: reportlab -Version: 3.5.46 +Version: 3.5.51 Summary: The Reportlab Toolkit Home-page: http://www.reportlab.com/ Author: Andy Robinson, Robin Becker, the ReportLab team and the community diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/rl_addons/renderPM/_renderPM.c new/reportlab-3.5.51/src/rl_addons/renderPM/_renderPM.c --- old/reportlab-3.5.46/src/rl_addons/renderPM/_renderPM.c 2020-07-20 09:39:52.000000000 +0200 +++ new/reportlab-3.5.51/src/rl_addons/renderPM/_renderPM.c 2020-09-18 15:27:00.000000000 +0200 @@ -21,7 +21,7 @@ #endif -#define VERSION "3.03" +#define VERSION "3.04" #define MODULENAME "_renderPM" #ifdef isPy3 # define PyInt_FromLong PyLong_FromLong @@ -43,29 +43,38 @@ # define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) # endif #endif - +#define __STR(x) #x +#define STRINGIFY(x) __STR(x) #ifndef LIBART_VERSION -# define LIBART_VERSION "?.?.?" +# define LIBART_VERSION ?.?.? #endif #ifdef RENDERPM_FT -# define _FT_DOC " ft_get_face(fontName) --> ft_face instance\n" +# define _FT_DOC " _renderPM.ft_get_face(fontName) --> ft_face instance\n" #else # define _FT_DOC "" #endif +#ifdef MEMORY_DEBUG +# define _MDBG_DOC " _renderPM.mtrace(int) start or stop the malloc tracing\n" +#else +# define _MDBG_DOC "" +#endif PyDoc_STRVAR(__DOC__, "Helper extension module for renderPM.\n\ \n\ Interface summary:\n\ \n\ - import _renderPM\n\ - gstate(width,height[,depth=3,bg=0xffffff]) #create an initialised graphics state\n\ - makeT1Font(fontName,pfbPath,names[,reader]) #make a T1 font\n\ - delCache() #delete all T1 font info\n\ - pil2pict(cols,rows,datastr,palette) return PICT version of im as bytes\n" + from reportlan.graphics import _renderPM\n\ + _renderPM.gstate(width,height[,depth=3,bg=0xffffff]) create an \n\ + initialised graphics state\n\ + _renderPM.makeT1Font(fontName,pfbPath,names[,reader]) make a T1 font\n\ + _renderPM.delCache() delete all T1 font info\n\ + _renderPM.pil2pict(cols,rows,datastr,palette) return PICT version of\n\ + im as bytes\n" _FT_DOC +_MDBG_DOC "\n\ - _libart_version # base library version string\n\ - _version # module version string\n\ + _renderPM._libart_version base library version string\n\ + _renderPM._version module version string ie " VERSION "\n\ "); #if PY_VERSION_HEX < 0x01060000 @@ -647,8 +656,8 @@ if(fabs(a)>1e-7){ /*fill only larger things*/ tmp_vpath = art_vpath_perturb(trVpath); - trVpath = art_vpath_perturb(tmp_vpath); - art_free(tmp_vpath); + art_free(trVpath); /*free the original*/ + trVpath = tmp_vpath; svp = art_svp_from_vpath(trVpath); dump_svp("fill svp from vpath",svp); if(fillMode==0){ @@ -1849,6 +1858,22 @@ Py_INCREF(Py_None); return Py_None; } +#ifdef MEMORY_DEBUG +#include <mcheck.h> +static PyObject* _py_mtrace(PyObject* self, PyObject* args) +{ + int startStop; + if(!PyArg_ParseTuple(args,"i:mtrace",&startStop)) return NULL; + if (startStop) { + mtrace(); + } + else { + muntrace(); + } + Py_INCREF(Py_None); + return Py_None; +} +#endif #define HEADER_SIZE 512 @@ -2090,7 +2115,7 @@ static struct PyMethodDef _methods[] = { - {"gstate", (PyCFunction)gstate, METH_VARARGS|METH_KEYWORDS, "gstate(width,height[,depth=3][,bg=0xffffff]) create an initialised graphics state"}, + {"gstate", (PyCFunction)gstate, METH_VARARGS|METH_KEYWORDS, "gstate(width,height[,depth=3][,bg=0xffffff]) create an\n initialised graphics state"}, {"makeT1Font", (PyCFunction)makeT1Font, METH_VARARGS|METH_KEYWORDS, "makeT1Font(fontName,pfbPath,names)"}, {"delCache", (PyCFunction)delCache, METH_VARARGS, "delCache()"}, {"pil2pict", (PyCFunction)pil2pict, METH_VARARGS, "pil2pict(cols,rows,datastr,palette) return PICT version of im as bytes"}, @@ -2098,6 +2123,9 @@ {"ft_get_face", (PyCFunction)ft_get_face, METH_VARARGS|METH_KEYWORDS,"ft_get_face(fontName) --> ft_face instance"}, {"parse_utf8", (PyCFunction)parse_utf8, METH_VARARGS, "parse_utf8(utf8_string) return UCS list"}, #endif /*ifdef RENDERPM_FT*/ +#ifdef MEMORY_DEBUG + {"mtrace", (PyCFunction)_py_mtrace, METH_VARARGS|METH_KEYWORDS,"mtrace(startStop) start or stop malloc tracing"}, +#endif /*MEMORY_DEBUG*/ {NULL, NULL} /*sentinel*/ }; @@ -2147,7 +2175,7 @@ if(!obj)goto err; PyModule_AddObject(m, "_version", obj); - obj = PyUnicode_FromString(LIBART_VERSION); + obj = PyUnicode_FromString(STRINGIFY(LIBART_VERSION)); if(!obj)goto err; PyModule_AddObject(m, "_libart_version", obj); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/src/rl_addons/rl_accel/_rl_accel.c new/reportlab-3.5.51/src/rl_addons/rl_accel/_rl_accel.c --- old/reportlab-3.5.46/src/rl_addons/rl_accel/_rl_accel.c 2019-10-01 17:38:11.000000000 +0200 +++ new/reportlab-3.5.51/src/rl_addons/rl_accel/_rl_accel.c 2020-09-24 15:27:24.000000000 +0200 @@ -368,7 +368,7 @@ else PyErr_Clear(); Py_DECREF(retVal); } - buf=malloc(31*aL); + buf = malloc(31*aL+1); /*add the 1 in case aL is 0 thanks to Hans-Peter Jansen <h...@urpla.net>*/ pB = buf; for(i=0;i<aL;i++){ retVal = PySequence_GetItem(args,i); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/tests/test_pdfgen_general.py new/reportlab-3.5.51/tests/test_pdfgen_general.py --- old/reportlab-3.5.46/tests/test_pdfgen_general.py 2019-10-01 17:38:11.000000000 +0200 +++ new/reportlab-3.5.51/tests/test_pdfgen_general.py 2020-09-18 15:27:00.000000000 +0200 @@ -1119,6 +1119,22 @@ canv.drawString(x+80+1,y+23,'Alpha=%.1f' % alpha) canv.rect(x+90,y+10,10,10,fill=1) canv.setFillOverprint(op) + canv.setBlendMode('Multiply') + canv.setBlendMode('Screen') + canv.setBlendMode('Overlay') + canv.setBlendMode('Darken') + canv.setBlendMode('Lighten') + canv.setBlendMode('ColorDodge') + canv.setBlendMode('ColorBurn') + canv.setBlendMode('HardLight') + canv.setBlendMode('SoftLight') + canv.setBlendMode('Difference') + canv.setBlendMode('Exclusion') + canv.setBlendMode('Hue') + canv.setBlendMode('Saturation') + canv.setBlendMode('Color') + canv.setBlendMode('Luminosity') + canv.setBlendMode('Normal') canv.drawString(x+120+1,y+3,'OP=%d' % int(op)) canv.drawString(x+120+1,y+23,'Alpha=%.1f' % alpha) canv.rect(x+130,y+10,10,10,fill=1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/reportlab-3.5.46/tests/test_platypus_breaking.py new/reportlab-3.5.51/tests/test_platypus_breaking.py --- old/reportlab-3.5.46/tests/test_platypus_breaking.py 2020-01-22 15:40:54.000000000 +0100 +++ new/reportlab-3.5.51/tests/test_platypus_breaking.py 2020-09-02 14:34:06.000000000 +0200 @@ -161,7 +161,10 @@ return story for sfx,klass in (('',KeepTogether),('_ktsat',KeepTogetherSplitAtTop)): - doc = MyDocTemplate(outputfile('test_platypus_breaking%s.pdf'%sfx),keepTogetherClass=klass) + doc = MyDocTemplate(outputfile('test_platypus_breaking%s.pdf'%sfx),keepTogetherClass=klass, + displayDocTitle=(sfx==''), + duplex='Simplex', + ) doc.multiBuild(makeStory()) class BreakingTestCase(unittest.TestCase):