Hello community, here is the log from the commit of package python-relatorio for openSUSE:Factory checked in at 2017-12-14 10:57:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-relatorio (Old) and /work/SRC/openSUSE:Factory/.python-relatorio.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-relatorio" Thu Dec 14 10:57:26 2017 rev:5 rq:555893 version:0.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-relatorio/python-relatorio.changes 2017-10-21 20:21:36.491471356 +0200 +++ /work/SRC/openSUSE:Factory/.python-relatorio.new/python-relatorio.changes 2017-12-14 10:57:29.287600635 +0100 @@ -1,0 +2,16 @@ +Mon Dec 11 09:55:31 UTC 2017 - tchva...@suse.com + +- Explain why the tests are conditioned around +- Specify all the runtime dependencies based on setup.py + +------------------------------------------------------------------- +Sat Dec 9 16:12:18 UTC 2017 - axel.br...@gmx.de + +- version 0.8.0 + * Do not guess_type on styled cell content + * Remove type attributes when guessing type + * Add support for Python 3.6 + * Remove soft-page-break + * tests added to spec file + +------------------------------------------------------------------- Old: ---- relatorio-0.7.1.tar.gz New: ---- relatorio-0.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-relatorio.spec ++++++ --- /var/tmp/diff_new_pack.rJBfUV/_old 2017-12-14 10:57:30.147559121 +0100 +++ /var/tmp/diff_new_pack.rJBfUV/_new 2017-12-14 10:57:30.147559121 +0100 @@ -18,10 +18,10 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} - +%bcond_with tests %define mod_name relatorio Name: python-relatorio -Version: 0.7.1 +Version: 0.8.0 Release: 0 Summary: Python module to create reports from Python objects License: GPL-3.0+ @@ -30,11 +30,14 @@ Source: https://pypi.io/packages/source/r/%{mod_name}/%{mod_name}-%{version}.tar.gz BuildRequires: %{python_module Genshi} BuildRequires: %{python_module lxml} +# It requires different magic for tests https://github.com/ahupp/python-magic +#BuildRequires: %{python_module magic} BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros +Requires: python-Genshi Requires: python-PyYAML +Requires: python-lxml Requires: python-pycha -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %python_subpackages @@ -52,8 +55,12 @@ %install %python_install +%if %{with tests} +%check +%python_exec setup.py test +%endif + %files %{python_files} -%defattr(-,root,root) %doc README AUTHORS LICENSE %{python_sitelib}/* ++++++ relatorio-0.7.1.tar.gz -> relatorio-0.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/.drone.yml new/relatorio-0.8.0/.drone.yml --- old/relatorio-0.7.1/.drone.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/.drone.yml 2017-11-20 11:04:12.000000000 +0100 @@ -0,0 +1,27 @@ +clone: + hg: + image: plugins/hg + +pipeline: + tox: + image: ${IMAGE} + commands: + - pip install tox + - apt-get update + - apt-get install -y python-cairo + - tox -e "${TOXENV}" + volumes: + - cache:/root/.cache + +matrix: + include: + - IMAGE: python:2.7 + TOXENV: py27 + - IMAGE: python:3.3 + TOXENV: py33 + - IMAGE: python:3.4 + TOXENV: py34 + - IMAGE: python:3.5 + TOXENV: py35 + - IMAGE: python:3.6 + TOXENV: py36 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/.hgignore new/relatorio-0.8.0/.hgignore --- old/relatorio-0.7.1/.hgignore 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/.hgignore 2013-01-26 14:52:57.000000000 +0100 @@ -0,0 +1,12 @@ +syntax:glob +*.pyc +.*.swp +.coverage +relatorio.egg-info/ +examples/output_* +examples/hbar.svg +examples/line.png +examples/pie.png +examples/vbar.svg +dist/ +build/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/.hgtags new/relatorio-0.8.0/.hgtags --- old/relatorio-0.7.1/.hgtags 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/.hgtags 2017-12-04 16:25:33.000000000 +0100 @@ -0,0 +1,26 @@ +e876d1a8aa91987be7fcfd8c96d56e9818436901 0.1.0 +11caddcad2239862ac8bb3902fc42337361b1d1b 0.1.1 +e3c7c71b212489adf6831bb4d51f83d53e6076e1 0.2.0 +287d6310d2ef7881221eddb65202212bada2e9b7 0.3.0 +a8fb9b03615b19e0e5b1027e81293904bb204cdd 0.4.0 +db423938f1d913e220163e87d111e9877f8e0f7a 0.4.1 +de87333baeaff772e904a2c60d0c8665dce821b7 0.5.0 +9b5bd4d4702f6b8652bfa8fd91103cf6b2dbc386 0.5.1 +9b5bd4d4702f6b8652bfa8fd91103cf6b2dbc386 0.5.1 +0000000000000000000000000000000000000000 0.5.1 +0000000000000000000000000000000000000000 0.5.1 +9bba1a2a16a11bfe7c96e4a6c81485457a7e77e2 0.5.1 +c4a133c148e17588b7cb21764758643d82ed7e91 0.5.2 +e34d189704643505397e0f8ba3a5bf92dade3003 0.5.3 +8960712aea29168b51bb46077c8a8d2f2fd0dcd2 0.5.4 +ec0f2bfc7521e95835bd712c7cc811d39d1168a3 0.5.5 +4c36447e560735d81d08bd184c46e20c1109b919 0.5.6 +4fc1c686d470c48d8c9f3bb5971fc05318053318 0.5.7 +66bfb506d014824f0afcb2c90d6503272132b99e 0.6.0 +8360160b8e383c34c4d7a097d76f4eec2eceaad8 0.6.1 +c408416e6e3d2bea0732dca1207ad994d42a0c5e 0.6.2 +fb1791ac5742e87cc24031990938d539c9f2dae4 0.6.3 +1b55b174419d6837f37cc33aa41c6db65d56e538 0.6.4 +50115e7464e35bc1517b23ed4fd4eed1d284273a 0.7.0 +8ee1d7515d35918944151d3a44003063e1ab6a18 0.7.1 +0775b131b51d40c2147b1ae104f760698a8d9f9e 0.8.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/CHANGES new/relatorio-0.8.0/CHANGES --- old/relatorio-0.7.1/CHANGES 2017-10-08 17:40:18.000000000 +0200 +++ new/relatorio-0.8.0/CHANGES 2017-12-03 22:12:27.000000000 +0100 @@ -1,3 +1,9 @@ +0.8.0 - 20171204 +* Do not guess_type on styled cell content +* Remove type attributes when guessing type +* Add support for Python 3.6 +* Remove soft-page-break + 0.7.1 - 20171008 * Remove warning when import plugin fails * Apply the guess type function on the correct node diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/PKG-INFO new/relatorio-0.8.0/PKG-INFO --- old/relatorio-0.7.1/PKG-INFO 2017-10-08 17:48:35.000000000 +0200 +++ new/relatorio-0.8.0/PKG-INFO 2017-12-04 16:26:16.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: relatorio -Version: 0.7.1 +Version: 0.8.0 Summary: A templating library able to output odt and pdf files Home-page: http://relatorio.tryton.org/ Author: Cedric Krier @@ -21,14 +21,6 @@ The documenation is provided at http://relatorio.readthedocs.org/ - Note on PyCha - ============= - - Since the 0.4.0 release, pycha upstream author included most of our patches. So - it is not necessary anymore to use our friendly fork of the project. - - For SVG support, you need PyCha 0.4.2 or later. - Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/README new/relatorio-0.8.0/README --- old/relatorio-0.7.1/README 2016-06-14 11:33:18.000000000 +0200 +++ new/relatorio-0.8.0/README 2017-11-20 10:47:20.000000000 +0100 @@ -12,11 +12,3 @@ ============ The documenation is provided at http://relatorio.readthedocs.org/ - -Note on PyCha -============= - -Since the 0.4.0 release, pycha upstream author included most of our patches. So -it is not necessary anymore to use our friendly fork of the project. - -For SVG support, you need PyCha 0.4.2 or later. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/doc/conf.py new/relatorio-0.8.0/doc/conf.py --- old/relatorio-0.7.1/doc/conf.py 2017-07-29 19:01:46.000000000 +0200 +++ new/relatorio-0.8.0/doc/conf.py 2017-12-03 22:11:45.000000000 +0100 @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = '0.7' +version = '0.8' # The full version, including alpha/beta/rc tags. -release = '0.7.1' +release = '0.8.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. Binary files old/relatorio-0.7.1/examples/basic.odt and new/relatorio-0.8.0/examples/basic.odt differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/basic.tex new/relatorio-0.8.0/examples/basic.tex --- old/relatorio-0.7.1/examples/basic.tex 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/basic.tex 2013-01-26 14:52:57.000000000 +0100 @@ -0,0 +1,21 @@ +\enableregime [utf-8] +\mainlanguage [fr] + +\starttext + +Dear $o.customer.name, + +Here is the list of your purchases: + +\starttable[|l|l|l|l|l|] +\HL +\NC Name \VL Reference \VL Quantity \VL Unit Price \VL Amount \SR +\HL +{% for line in o.lines%} \ +\NC $line.item.name \VL $line.item.reference \VL $line.quantity +\VL $line.item.price \VL $line.amount \SR +\HL \ +{% end %} +\stoptable + +\stoptext Binary files old/relatorio-0.7.1/examples/bouteille.png and new/relatorio-0.8.0/examples/bouteille.png differ Binary files old/relatorio-0.7.1/examples/columns.odt and new/relatorio-0.8.0/examples/columns.odt differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/common.py new/relatorio-0.8.0/examples/common.py --- old/relatorio-0.7.1/examples/common.py 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/common.py 2017-11-20 10:46:54.000000000 +0100 @@ -0,0 +1,43 @@ +from os.path import join, dirname + + +class Invoice(dict): + + @property + def total(self): + return sum(l['amount'] for l in self['lines']) + + @property + def vat(self): + return self.total * 0.21 + + +inv = Invoice(customer={'name': 'John Bonham', + 'address': {'street': 'Smirnov street', + 'zip': 1000, + 'city': 'Montreux'}}, + lines=[{'item': {'name': 'Vodka 70cl', + 'reference': 'VDKA-001', + 'price': 10.34}, + 'quantity': 7, + 'amount': 7 * 10.34}, + {'item': {'name': 'Cognac 70cl', + 'reference': 'CGNC-067', + 'price': 13.46}, + 'quantity': 12, + 'amount': 12 * 13.46}, + {'item': {'name': 'Sparkling water 25cl', + 'reference': 'WATR-007', + 'price': 4}, + 'quantity': 1, + 'amount': 4}, + {'item': {'name': 'Good customer', + 'reference': 'BONM-001', + 'price': -20}, + 'quantity': 1, + 'amount': -20}, + ], + id='MZY-20080703', + status='late', + bottle=(open(join(dirname(__file__), 'bouteille.png'), 'rb'), + 'image/png')) Binary files old/relatorio-0.7.1/examples/complicated.odt and new/relatorio-0.8.0/examples/complicated.odt differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/demo_chart.py new/relatorio-0.8.0/examples/demo_chart.py --- old/relatorio-0.7.1/examples/demo_chart.py 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/demo_chart.py 2013-07-22 16:25:14.000000000 +0200 @@ -0,0 +1,23 @@ +from os.path import abspath, join, dirname +from relatorio import Report + +# test data +from common import inv + +if __name__ == '__main__': + pie_report = Report(abspath(join(dirname(__file__), 'pie_chart')), + 'image/png') + open(join(dirname(__file__), 'pie.png'), 'wb').write( + pie_report(o=inv).render().getvalue()) + hbar_report = Report(abspath(join(dirname(__file__), 'hbar_chart')), + 'image/svg') + open(join(dirname(__file__), 'hbar.svg'), 'wb').write( + hbar_report(o=inv).render().getvalue()) + vbar_report = Report(abspath(join(dirname(__file__), 'vbar_chart')), + 'image/svg') + open(join(dirname(__file__), 'vbar.svg'), 'wb').write( + vbar_report(o=inv).render().getvalue()) + line_report = Report(abspath(join(dirname(__file__), 'line_chart')), + 'image/png') + open(join(dirname(__file__), 'line.png'), 'wb').write( + line_report(o=inv).render().getvalue()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/demo_context.py new/relatorio-0.8.0/examples/demo_context.py --- old/relatorio-0.7.1/examples/demo_context.py 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/demo_context.py 2017-11-20 10:46:54.000000000 +0100 @@ -0,0 +1,14 @@ +from os.path import abspath, join, dirname +from relatorio import Report + +# test data +from common import inv + +# PDF +if __name__ == '__main__': + print "generating output_basic.pdf... ", + report = Report(abspath(join(dirname(__file__), 'basic.tex')), + 'application/pdf') + content = report(o=inv).render().getvalue() + open(join(dirname(__file__), 'output_basic.pdf'), 'wb').write(content) + print "done" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/demo_odf.py new/relatorio-0.8.0/examples/demo_odf.py --- old/relatorio-0.7.1/examples/demo_odf.py 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/demo_odf.py 2017-11-20 10:46:54.000000000 +0100 @@ -0,0 +1,68 @@ +from os.path import abspath, join, dirname +from relatorio import Report +from relatorio.templates import opendocument + +# test data +from common import inv + +ODT_MIME = 'application/vnd.oasis.opendocument.text' +ODS_MIME = 'application/vnd.oasis.opendocument.spreadsheet' +ODP_MIME = 'application/vnd.oasis.opendocument.presentation' + +if __name__ == '__main__': + pwd = dirname(__file__) + # ODT + print "generating output_basic.odt... ", + report = Report(abspath(join(dirname(__file__), 'basic.odt')), ODT_MIME) + content = report(o=inv).render().getvalue() + open(join(pwd, 'output_basic.odt'), 'wb').write(content) + print "done" + + # we could also use an opendocument template directly + print "generating output_template_basic.odt... ", + template = opendocument.Template(source='', + filepath=abspath(join(pwd, 'basic.odt'))) + content = template.generate(o=inv).render().getvalue() + open(join(pwd, 'output_template_basic.odt'), 'wb').write(content) + print "done" + + print "generating output_complicated.odt... ", + # Add a chart to the invoice + inv['chart'] = ( + Report(abspath(join(pwd, 'pie_chart')), 'image/png'), 'image/png') + report = Report(abspath(join(pwd, 'complicated.odt')), ODT_MIME) + try: + content = report(o=inv).render().getvalue() + except NotImplementedError: + print "skipped" + else: + open(join(pwd, 'output_complicated.odt'), 'wb').write(content) + print "done" + + print "generating output_columns.odt... ", + report = Report(abspath(join(pwd, 'columns.odt')), ODT_MIME) + lst = [[], ['i'], ['a', 'b'], [1, 2, 3], ['I', 'II', 'III', 'IV']] + titles = ['first', 'second', 'third', 'fourth'] + content = report(titles=titles, lst=lst).render().getvalue() + open(join(pwd, 'output_columns.odt'), 'wb').write(content) + print "done" + + # ODS + print "generating output_pivot.ods... ", + report = Report(abspath(join(pwd, 'pivot.ods')), ODS_MIME) + content = report(o=inv).render().getvalue() + open(join(pwd, 'output_pivot.ods'), 'wb').write(content) + print "done" + + print "generating output_sheets.ods... ", + report = Report(abspath(join(pwd, 'demo_sheets.ods')), ODS_MIME) + content = report(lst=lst).render().getvalue() + open(join(pwd, 'output_sheets.ods'), 'wb').write(content) + print "done" + + # ODP + print "generating output_presentation.odp... ", + report = Report(abspath(join(pwd, 'presentation.odp')), ODP_MIME) + content = report(o=inv).render().getvalue() + open(join(pwd, 'output_presentation.odp'), 'wb').write(content) + print "done" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/demo_repository.py new/relatorio-0.8.0/examples/demo_repository.py --- old/relatorio-0.7.1/examples/demo_repository.py 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/demo_repository.py 2013-07-22 16:25:14.000000000 +0200 @@ -0,0 +1,32 @@ +import relatorio +from common import Invoice, inv +from os.path import join, dirname + +ODT_MIME = 'application/vnd.oasis.opendocument.text' +ODS_MIME = 'application/vnd.oasis.opendocument.spreadsheet' +ODP_MIME = 'application/vnd.oasis.opendocument.presentation' + +repository = relatorio.ReportRepository() +repository.add_report(Invoice, ODT_MIME, 'basic.odt', report_name='basic') +repository.add_report(Invoice, ODT_MIME, + 'complicated.odt', report_name='complicated') +repository.add_report(Invoice, ODS_MIME, 'pivot.ods', report_name='pivot') +repository.add_report(Invoice, ODP_MIME, + 'presentation.odp', report_name='presentation') +repository.add_report(Invoice, 'image/png', 'pie_chart', report_name='pie') + +if __name__ == '__main__': + # Add a chart to the invoice + inv['chart'] = repository.by_id(Invoice, 'pie')[:2] + + # Generate all reports on the invoice class + for report_name, ext in (('basic', '.odt'), + ('complicated', '.odt'), + ('pivot', '.ods'), + ('presentation', '.odp')): + filename = 'output_%s%s' % (report_name, ext) + print "generating '%s'..." % filename, + report, mimetype, desc = repository.by_id(Invoice, report_name) + data = report(o=inv).render().getvalue() + open(join(dirname(__file__), filename), 'wb').write(data) + print "done" Binary files old/relatorio-0.7.1/examples/demo_sheets.ods and new/relatorio-0.8.0/examples/demo_sheets.ods differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/hbar_chart new/relatorio-0.8.0/examples/hbar_chart --- old/relatorio-0.7.1/examples/hbar_chart 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/hbar_chart 2013-01-26 14:52:57.000000000 +0100 @@ -0,0 +1,32 @@ +options: + width: 600 + height: 500 + legend: + hide: false + position: + right: 40 + padding: {bottom: 70, left: 70, right: 10, top: 10} + axis: + y: + interval: 15 + padding: 5 + x: + ticks: + {% for idx, line in enumerate(o.lines) %} + - v: $idx + label: $line.item.name + {% end %} +chart: + type: hbar + output_type: svg + dataset: + - - Sales + - + {% for idx, line in enumerate(o.lines) %} + - [$idx, $line.amount] + {% end %} + - - Absolute sales + - + {% for idx, line in enumerate(o.lines) %} + - [$idx, ${abs(line.amount)}] + {% end %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/line_chart new/relatorio-0.8.0/examples/line_chart --- old/relatorio-0.7.1/examples/line_chart 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/line_chart 2013-01-26 14:52:57.000000000 +0100 @@ -0,0 +1,27 @@ +options: + width: 600 + height: 500 + legend: + hide: false + position: + right: 40 + padding: {bottom: 70, left: 70, right: 10, top: 10} + axis: + y: + interval: 10 + padding: 10 + x: + ticks: + {% for idx, line in enumerate(o.lines) %} + - v: $idx + label: $line.item.name + {% end %} +chart: + type: line + output_type: png + dataset: + - - Sales + - + {% for idx, line in enumerate(o.lines) %} + - [$idx, $line.amount] + {% end %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/pie_chart new/relatorio-0.8.0/examples/pie_chart --- old/relatorio-0.7.1/examples/pie_chart 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/pie_chart 2013-01-26 14:52:57.000000000 +0100 @@ -0,0 +1,15 @@ +options: + width: 600 + height: 400 + background: {hide: true} + legend: {hide: true} + axis: {labelFontSize: 14} + padding: {bottom: 10, left: 10, right: 10, top: 10} +chart: + type: pie + output_type: png + dataset: + {% for line in o.lines %} + - - ${line.item.name} + - - [0, $line.amount] + {% end %} Binary files old/relatorio-0.7.1/examples/pivot.ods and new/relatorio-0.8.0/examples/pivot.ods differ Binary files old/relatorio-0.7.1/examples/presentation.odp and new/relatorio-0.8.0/examples/presentation.odp differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/examples/vbar_chart new/relatorio-0.8.0/examples/vbar_chart --- old/relatorio-0.7.1/examples/vbar_chart 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/examples/vbar_chart 2013-01-26 14:52:57.000000000 +0100 @@ -0,0 +1,32 @@ +options: + width: 600 + height: 500 + legend: + hide: false + position: + right: 40 + padding: {bottom: 70, left: 70, right: 10, top: 10} + axis: + y: + interval: 20 + padding: 5 + x: + ticks: + {% for idx, line in enumerate(o.lines) %} + - v: $idx + label: $line.item.name + {% end %} +chart: + type: vbar + output_type: svg + dataset: + - - Sales + - + {% for idx, line in enumerate(o.lines) %} + - [$idx, $line.amount] + {% end %} + - - Absolute sales + - + {% for idx, line in enumerate(o.lines) %} + - [$idx, ${abs(line.amount)}] + {% end %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/relatorio/__init__.py new/relatorio-0.8.0/relatorio/__init__.py --- old/relatorio-0.7.1/relatorio/__init__.py 2017-07-29 19:01:12.000000000 +0200 +++ new/relatorio-0.8.0/relatorio/__init__.py 2017-12-03 22:11:59.000000000 +0100 @@ -12,5 +12,5 @@ from .reporting import MIMETemplateLoader, ReportRepository, Report from . import templates -__version__ = '0.7.1' +__version__ = '0.8.0' __all__ = ['MIMETemplateLoader', 'ReportRepository', 'Report', 'templates'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/relatorio/templates/opendocument.py new/relatorio-0.8.0/relatorio/templates/opendocument.py --- old/relatorio-0.7.1/relatorio/templates/opendocument.py 2017-10-08 17:38:46.000000000 +0200 +++ new/relatorio-0.8.0/relatorio/templates/opendocument.py 2017-11-20 11:57:58.000000000 +0100 @@ -211,6 +211,26 @@ old_parent.remove(last) +def remove_node_keeping_tail(node): + """Remove the node from the tree but keeping tail by appending to the + previous or parent node. + """ + parent = node.getparent() + if node.tail: + previous = node.getprevious() + if previous is not None: + if not previous.tail: + previous.tail = node.tail + else: + previous.tail += node.tail + else: + if not parent.text: + parent.text = node.tail + else: + parent.text += node.tail + parent.remove(node) + + def update_py_attrs(node, value): """An helper function to update py_attrs of a node. """ @@ -311,6 +331,7 @@ self.namespaces['py'] = GENSHI_URI self.namespaces['relatorio'] = RELATORIO_URI + self._remove_soft_page_break(tree) self._invert_style(tree) self._handle_relatorio_tags(tree) self._handle_images(tree) @@ -318,6 +339,17 @@ self._escape_values(tree) return BytesIO(lxml.etree.tostring(tree)) + def _remove_soft_page_break(self, tree): + "remove soft-page-break tag and use-soft-page-break attribute" + xpath_expr = "//text:soft-page-break" + for node in tree.xpath(xpath_expr, namespaces=self.namespaces): + remove_node_keeping_tail(node) + + xpath_expr = "//office:text[@text:use-soft-page-breaks]" + text_namespace = self.namespaces['text'] + for node in tree.xpath(xpath_expr, namespaces=self.namespaces): + node.attrib.pop('{%s}use-soft-page-breaks' % text_namespace) + def _invert_style(self, tree): "inverts the text:a and text:span" xpath_expr = "//text:a[starts-with(@xlink:href, 'relatorio://')]" \ @@ -396,6 +428,16 @@ table_namespace = self.namespaces['table'] table_row_tag = '{%s}table-row' % table_namespace table_cell_tag = '{%s}table-cell' % table_namespace + text_namespace = self.namespaces['text'] + text_style_attributes = [s % text_namespace for s in [ + '{%s}class-names', '{%s}cond-style-name', '{%s}style-name']] + + office_value = '{%s}value' % self.namespaces['office'] + office_valuetype = '{%s}value-type' % self.namespaces['office'] + if 'calcext' in self.namespaces: + calcext_valuetype = '{%s}value-type' % self.namespaces['calcext'] + else: + calcext_valuetype = None py_replace = '{%s}replace' % GENSHI_URI @@ -473,13 +515,17 @@ # remove the directive node r_node.getparent().remove(r_node) else: + def has_style(node): + return any(attr in node.attrib + for attr in text_style_attributes) # It's not a genshi statement it's a python expression parent = r_node.getparent() grand_parent = parent.getparent() # Guess type only if it is the only value in the cell + # and its parent has no style if (grand_parent is None or grand_parent.tag != table_cell_tag - ) or len(parent) != 1: + ) or len(grand_parent) != 1 or has_style(parent): r_node.attrib[py_replace] = expr continue @@ -491,6 +537,11 @@ dico = ('__relatorio_guess_type(' '__relatorio_store_cache(%s, %s))') update_py_attrs(grand_parent, dico % (cache_id, expr)) + for attr in [office_value, + office_valuetype, + calcext_valuetype]: + if attr: + grand_parent.attrib.pop(attr, None) def _handle_column_loops(self, statement, ancestor, opening, outer_o_node, outer_c_node): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/relatorio/tests/test_odt.py new/relatorio-0.8.0/relatorio/tests/test_odt.py --- old/relatorio-0.7.1/relatorio/tests/test_odt.py 2017-10-08 17:38:46.000000000 +0200 +++ new/relatorio-0.8.0/relatorio/tests/test_odt.py 2017-11-20 10:47:38.000000000 +0100 @@ -23,7 +23,7 @@ import os import unittest -from io import StringIO +from io import StringIO, BytesIO import lxml.etree from genshi.filters import Translator @@ -31,7 +31,7 @@ from genshi.template.eval import UndefinedError from relatorio.templates.opendocument import Template, GENSHI_EXPR,\ - GENSHI_URI, RELATORIO_URI, fod2od + GENSHI_URI, RELATORIO_URI, fod2od, remove_node_keeping_tail OO_TABLE_NS = "urn:oasis:names:tc:opendocument:xmlns:table:1.0" @@ -339,3 +339,76 @@ with open(filepath, mode='rb') as source: oot = Template(source) oot.generate(**self.data) + + +class TestRemoveNodeKeepingTail(unittest.TestCase): + + def test_without_tail(self): + "Testing remove_node_keeping_tail without tail" + xml = b'''<parent><target/></parent>''' + tree = lxml.etree.parse(BytesIO(xml)) + target = tree.getroot()[0] + + remove_node_keeping_tail(target) + + self.assertEqual(lxml.etree.tostring(tree), b'''<parent/>''') + + def test_with_tail(self): + "Testing remove_node_keeping_tail with tail" + xml = b'''<parent><target/>tail</parent>''' + tree = lxml.etree.parse(BytesIO(xml)) + target = tree.getroot()[0] + + remove_node_keeping_tail(target) + + self.assertEqual( + lxml.etree.tostring(tree), + b'''<parent>tail</parent>''') + + def test_with_tail_and_parent_text(self): + "Testing remove_node_keeping_tail with tail and parent text" + xml = b'''<parent>text<target/>tail</parent>''' + tree = lxml.etree.parse(BytesIO(xml)) + target = tree.getroot()[0] + + remove_node_keeping_tail(target) + + self.assertEqual( + lxml.etree.tostring(tree), + b'''<parent>texttail</parent>''') + + def test_without_tail_and_with_previous(self): + "Testing remove_node_keeping_tail without tail and with previous" + xml = b'''<parent><previous/><target/></parent>''' + tree = lxml.etree.parse(BytesIO(xml)) + target = tree.getroot()[1] + + remove_node_keeping_tail(target) + + self.assertEqual( + lxml.etree.tostring(tree), + b'''<parent><previous/></parent>''') + + def test_with_tail_and_previous(self): + "Testing remove_node_keeping_tail with tail and previous" + xml = b'''<parent><previous/><target/>tail</parent>''' + tree = lxml.etree.parse(BytesIO(xml)) + target = tree.getroot()[1] + + remove_node_keeping_tail(target) + + self.assertEqual( + lxml.etree.tostring(tree), + b'''<parent><previous/>tail</parent>''') + + def test_with_tail_and_previous_tail(self): + "Testing remove_node_keeping_tail with tail and previous tail" + xml = b'''<parent><previous/>tail<target/>tail</parent>''' + tree = lxml.etree.parse(BytesIO(xml)) + target = tree.getroot()[1] + + remove_node_keeping_tail(target) + + self.assertEqual( + lxml.etree.tostring(tree), + b'''<parent><previous/>tailtail</parent>''') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/relatorio.egg-info/PKG-INFO new/relatorio-0.8.0/relatorio.egg-info/PKG-INFO --- old/relatorio-0.7.1/relatorio.egg-info/PKG-INFO 2017-10-08 17:48:33.000000000 +0200 +++ new/relatorio-0.8.0/relatorio.egg-info/PKG-INFO 2017-12-04 16:26:14.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: relatorio -Version: 0.7.1 +Version: 0.8.0 Summary: A templating library able to output odt and pdf files Home-page: http://relatorio.tryton.org/ Author: Cedric Krier @@ -21,14 +21,6 @@ The documenation is provided at http://relatorio.readthedocs.org/ - Note on PyCha - ============= - - Since the 0.4.0 release, pycha upstream author included most of our patches. So - it is not necessary anymore to use our friendly fork of the project. - - For SVG support, you need PyCha 0.4.2 or later. - Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/relatorio.egg-info/SOURCES.txt new/relatorio-0.8.0/relatorio.egg-info/SOURCES.txt --- old/relatorio-0.7.1/relatorio.egg-info/SOURCES.txt 2017-10-08 17:48:33.000000000 +0200 +++ new/relatorio-0.8.0/relatorio.egg-info/SOURCES.txt 2017-12-04 16:26:14.000000000 +0100 @@ -1,3 +1,6 @@ +.drone.yml +.hgignore +.hgtags AUTHORS CHANGES LICENSE @@ -5,6 +8,7 @@ README setup.cfg setup.py +tox.ini doc/Makefile doc/basic.png doc/basic_generated.png @@ -22,6 +26,23 @@ doc/pivot_rendered.png doc/quickexample.rst doc/relatorio_basic.png +examples/basic.odt +examples/basic.tex +examples/bouteille.png +examples/columns.odt +examples/common.py +examples/complicated.odt +examples/demo_chart.py +examples/demo_context.py +examples/demo_odf.py +examples/demo_repository.py +examples/demo_sheets.ods +examples/hbar_chart +examples/line_chart +examples/pie_chart +examples/pivot.ods +examples/presentation.odp +examples/vbar_chart relatorio/__init__.py relatorio/reporting.py relatorio.egg-info/PKG-INFO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/relatorio-0.7.1/tox.ini new/relatorio-0.8.0/tox.ini --- old/relatorio-0.7.1/tox.ini 1970-01-01 01:00:00.000000000 +0100 +++ new/relatorio-0.8.0/tox.ini 2017-11-20 11:04:12.000000000 +0100 @@ -0,0 +1,13 @@ +# Tox (http://tox.testrun.org/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = py26, py27, py32, py33, py34, py35, py36, pypy + +[testenv] +commands = {envpython} setup.py test +deps = + pyyaml + pycha