[tryton-debian-vcs] relatorio branch upstream updated. upstream/0.7.0-1-ga4bb343

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Thu Nov 2 13:41:49 UTC 2017


The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/relatorio.git;a=commitdiff;h=upstream/0.7.0-1-ga4bb343

commit a4bb343cb680278c34dffcef23f6d2780350697a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Oct 31 17:15:13 2017 +0100

    New upstream version 0.7.1

diff --git a/CHANGES b/CHANGES
index 655633d..4b6c809 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+0.7.1 - 20171008
+* Remove warning when import plugin fails
+* Apply the guess type function on the correct node
+* Fix guess_type for date and datetime
+
 0.7.0 - 20170729
 * Replace hard-coded extensions by mimetypes guess
 * Add more guess types: 'boolean', 'date', 'time' and 'void'
diff --git a/PKG-INFO b/PKG-INFO
index 0c76237..2c3578f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: relatorio
-Version: 0.7.0
+Version: 0.7.1
 Summary: A templating library able to output odt and pdf files
 Home-page: http://relatorio.tryton.org/
 Author: Cedric Krier
diff --git a/doc/conf.py b/doc/conf.py
index 4c4cdf8..433badb 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -50,7 +50,7 @@ copyright = u'2015, Nicolas Évrard, CGaëtan de Menten, Cédric Krier'
 # The short X.Y version.
 version = '0.7'
 # The full version, including alpha/beta/rc tags.
-release = '0.7.0'
+release = '0.7.1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/relatorio.egg-info/PKG-INFO b/relatorio.egg-info/PKG-INFO
index 0c76237..2c3578f 100644
--- a/relatorio.egg-info/PKG-INFO
+++ b/relatorio.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: relatorio
-Version: 0.7.0
+Version: 0.7.1
 Summary: A templating library able to output odt and pdf files
 Home-page: http://relatorio.tryton.org/
 Author: Cedric Krier
diff --git a/relatorio/__init__.py b/relatorio/__init__.py
index 237103b..f2bb8da 100644
--- a/relatorio/__init__.py
+++ b/relatorio/__init__.py
@@ -12,5 +12,5 @@ and report together, find reports by mimetypes/name/python objects.
 from .reporting import MIMETemplateLoader, ReportRepository, Report
 from . import templates
 
-__version__ = '0.7.0'
+__version__ = '0.7.1'
 __all__ = ['MIMETemplateLoader', 'ReportRepository', 'Report', 'templates']
diff --git a/relatorio/reporting.py b/relatorio/reporting.py
index bfbff5a..63c9eb9 100644
--- a/relatorio/reporting.py
+++ b/relatorio/reporting.py
@@ -18,13 +18,13 @@
 #
 ###############################################################################
 
-__metaclass__ = type
-
 import os
 import sys
 
 from genshi.template import TemplateLoader
 
+__metaclass__ = type
+
 
 def _absolute(path):
     "Compute the absolute path of path relative to the caller file"
diff --git a/relatorio/templates/__init__.py b/relatorio/templates/__init__.py
index c514f00..3d72734 100644
--- a/relatorio/templates/__init__.py
+++ b/relatorio/templates/__init__.py
@@ -18,12 +18,7 @@
 #
 ###############################################################################
 
-import warnings
-
 plugins = ['base', 'opendocument', 'pdf', 'chart']
 
 for name in plugins:
-    try:
-        __import__('relatorio.templates.%s' % name)
-    except ImportError:
-        warnings.warn("Unable to load plugin '%s'" % name)
+    __import__('relatorio.templates.%s' % name)
diff --git a/relatorio/templates/base.py b/relatorio/templates/base.py
index 27ac7a5..9c737e1 100644
--- a/relatorio/templates/base.py
+++ b/relatorio/templates/base.py
@@ -18,13 +18,13 @@
 #
 ###############################################################################
 
-__metaclass__ = type
-
 import genshi.core
 from genshi.template import NewTextTemplate, MarkupTemplate
 
 from relatorio.reporting import MIMETemplateLoader
 
+__metaclass__ = type
+
 
 class RelatorioStream(genshi.core.Stream):
     "Base class for the relatorio streams."
diff --git a/relatorio/templates/chart.py b/relatorio/templates/chart.py
index d11a99e..5e088c8 100644
--- a/relatorio/templates/chart.py
+++ b/relatorio/templates/chart.py
@@ -19,11 +19,8 @@
 #
 ###############################################################################
 
-__metaclass__ = type
-
 from io import BytesIO, StringIO
 
-import yaml
 import genshi
 import genshi.output
 from genshi.template import NewTextTemplate
@@ -31,19 +28,26 @@ from genshi.template import NewTextTemplate
 from relatorio.templates.base import RelatorioStream
 from relatorio.reporting import MIMETemplateLoader
 
-import cairo
-import pycha
-import pycha.pie
-import pycha.line
-import pycha.bar
-
-PYCHA_TYPE = {'pie': pycha.pie.PieChart,
-              'vbar': pycha.bar.VerticalBarChart,
-              'hbar': pycha.bar.HorizontalBarChart,
-              'line': pycha.line.LineChart,
-             }
+try:
+    import yaml
+    import cairo
+    import pycha
+    import pycha.pie
+    import pycha.line
+    import pycha.bar
+
+    PYCHA_TYPE = {'pie': pycha.pie.PieChart,
+                  'vbar': pycha.bar.VerticalBarChart,
+                  'hbar': pycha.bar.HorizontalBarChart,
+                  'line': pycha.line.LineChart,
+                 }
+except ImportError:
+    yaml = cairo = None
+    PYCHA_TYPE = {}
 _encode = genshi.output.encode
 
+__metaclass__ = type
+
 
 class Template(NewTextTemplate):
     "A chart templating object"
@@ -65,6 +69,8 @@ class CairoSerializer:
         self.text_serializer = genshi.output.TextSerializer()
 
     def __call__(self, stream):
+        if not PYCHA_TYPE:
+            raise NotImplementedError
         result = BytesIO()
         yml = StringIO(_encode(self.text_serializer(stream)))
         chart_yaml = yaml.load(yml.read())
diff --git a/relatorio/templates/opendocument.py b/relatorio/templates/opendocument.py
index d6e3112..b72a075 100644
--- a/relatorio/templates/opendocument.py
+++ b/relatorio/templates/opendocument.py
@@ -19,8 +19,6 @@
 #
 ###############################################################################
 
-__metaclass__ = type
-
 import re
 try:
     # requires python 2.5+
@@ -40,7 +38,6 @@ from decimal import Decimal
 
 
 import warnings
-warnings.filterwarnings('always', module='relatorio.templates.opendocument')
 
 import lxml.etree
 import genshi
@@ -59,6 +56,9 @@ try:
 except ImportError:
     ChartTemplate = type(None)
 
+__metaclass__ = type
+warnings.filterwarnings('always', module='relatorio.templates.opendocument')
+
 GENSHI_EXPR = re.compile(r'''
         (/)?                                 # is this a closing tag?
         (for|if|choose|when|otherwise|with|
@@ -490,7 +490,7 @@ class Template(MarkupTemplate):
                 # correct value and type for this cell.
                 dico = ('__relatorio_guess_type('
                         '__relatorio_store_cache(%s, %s))')
-                update_py_attrs(parent, dico % (cache_id, expr))
+                update_py_attrs(grand_parent, dico % (cache_id, expr))
 
     def _handle_column_loops(self, statement, ancestor, opening,
                              outer_o_node, outer_c_node):
@@ -734,7 +734,7 @@ class Template(MarkupTemplate):
             val = str(val).lower()
         elif isinstance(val, datetime.date):
             type_ = 'date'
-            val = val.date()
+            val = val.isoformat()
         elif isinstance(val, (int, float, long, Decimal)):
             type_ = 'float'
         elif isinstance(val, basestring):
@@ -867,6 +867,7 @@ def fod2od(source):
         manifest.add_file_entry(fname, mime_type)
     odt_zip.writestr(MANIFEST, str(manifest))
     odt_zip.writestr('mimetype', mimetype)
+    odt_zip.close()
     return odt_io
 
 
diff --git a/relatorio/templates/pdf.py b/relatorio/templates/pdf.py
index f21945b..a444cc7 100644
--- a/relatorio/templates/pdf.py
+++ b/relatorio/templates/pdf.py
@@ -19,8 +19,6 @@
 #
 ###############################################################################
 
-__metaclass__ = type
-
 import os
 import shutil
 import tempfile
@@ -34,6 +32,8 @@ from genshi.template import NewTextTemplate
 from relatorio.templates.base import RelatorioStream
 from relatorio.reporting import MIMETemplateLoader
 
+__metaclass__ = type
+
 TEXEXEC = 'texexec'
 _encode = genshi.output.encode
 
-- 
relatorio



More information about the tryton-debian-vcs mailing list