[tryton-debian-vcs] relatorio branch debian updated. debian/0.6.4-2-15-g0b19527

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


The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/relatorio.git;a=commitdiff;h=debian/0.6.4-2-15-g0b19527
  discards  df98fbbf5e48a9856a4c6a0a2c8d895d30f738aa (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (df98fbbf5e48a9856a4c6a0a2c8d895d30f738aa)
            \
             N -- N -- N (0b1952787575378dbd3892c920e3931f5e6f56da)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

commit 0b1952787575378dbd3892c920e3931f5e6f56da
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Nov 2 14:40:08 2017 +0100

    Releasing debian version 0.7.1-1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/debian/changelog b/debian/changelog
index 8a86ec7..bb2894b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+relatorio (0.7.1-1) unstable; urgency=medium
+
+  * Use the preferred https URL format in the copyright file.
+  * Bump the Standards-Version to 4.0.1.
+  * Bump the Standards-Version to 4.1.0, no changes needed.
+  * Add the current signing key of the maintainer.
+  * Merging upstream version 0.7.0.
+  * Update the d/copyright file.
+  * Add new Build-Depends for version 7.0.
+  * Disable tests temporarily due to missing Build-Depends.
+  * Bump Standards-Version to 4.1.1, no changes needed.
+  * Merging upstream version 0.7.1.
+  * Add 01-add-pypi-magic.patch.
+  * Add copyright for thirdparty/magic/magic.py.
+  * Use https in the watch file.
+  * Re-enable the tests.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Thu, 02 Nov 2017 14:26:14 +0100
+
 relatorio (0.6.4-2) unstable; urgency=medium
 
   * Change the maintainer address to tryton-debian at lists.alioth.debian.org
commit 387fcdc570d9a96755491b542adcbf562bc9fa25
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Nov 2 14:39:43 2017 +0100

    Re-enable the build tests.

diff --git a/debian/rules b/debian/rules
index 3040832..c7a4d99 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,13 +2,6 @@
 
 PACKAGE_NAME := $(shell python setup.py --name)
 export PYBUILD_NAME=$(PACKAGE_NAME)
-# Disable the tests temporarily until the correct build dependency for
-# python-magic is available in Debian.
-# For the time being we rely on the complete test suite
-# http://hg.tryton.org/relatorio/file/tip/.drone.yml
-# run at
-# http://tests.tryton.org
-export PYBUILD_DISABLE=test
 
 PYTHON2_VERSION = $(shell pyversions -d)
 PYTHON3_VERSION = $(shell py3versions -d)
commit 9310527e3002eabc62823b9279217e9f88a01f94
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Nov 2 14:24:42 2017 +0100

    Use https in the watch file.

diff --git a/debian/watch b/debian/watch
index 4e7e41f..097bf00 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,3 +1,3 @@
 version=3
 opts=uversionmangle=s/(rc|a|b|c)/~$1/,pgpsigurlmangle=s/$/.asc/ \
-http://pypi.debian.net/relatorio/relatorio-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
\ No newline at end of file
+https://pypi.debian.net/relatorio/relatorio-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
commit 049ca2a41246a4b6e16c352bb6fdf6b03076964a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Nov 1 17:43:34 2017 +0100

    Add copyright for thirdparty/magic/magic.py.

diff --git a/debian/copyright b/debian/copyright
index 950db46..fce7f16 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -33,6 +33,13 @@ Copyright: 2007-2008 OpenHex SPRL <http://www.openhex.com/>
            2014-2017 Cedric Krier
 License: GPL-3+
 
+Files: thirdparty/magic/*
+Copyright: 2011 Adam Hupp
+License: MIT
+Comment:
+ (upstream switched to from PSF to MIT on 4 jan 2014
+ https://github.com/ahupp/python-magic/commit/a0f2249dad53 )
+
 Files: debian/*
 Copyright: 2009-2012 Daniel Baumann <daniel at debian.org>
            2012-2017 Mathias Behrle <mathiasb at m9s.biz>
@@ -54,3 +61,23 @@ License: GPL-3+
  .
  The complete text of the GNU General Public License
  can be found in /usr/share/common-licenses/GPL-3 file.
+
+License: MIT
+ The MIT License
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights to
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ of the Software, and to permit persons to whom the Software is furnished to do
+ so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
commit 107167ee7f39c948b4aaf71227a94dc52e012b17
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Nov 1 17:41:50 2017 +0100

    Add 01-add-pypi-magic.patch.

diff --git a/debian/patches/01-add-pypi-magic.patch b/debian/patches/01-add-pypi-magic.patch
new file mode 100644
index 0000000..804bdb9
--- /dev/null
+++ b/debian/patches/01-add-pypi-magic.patch
@@ -0,0 +1,343 @@
+Description: Add python-magic code copy from Pypi.
+ Adding this code copy because of the (hopefully) ongoing merge
+ of python-magic(file) and python-magic(pypi). The first being available
+ in Debian as part of the file package, the latter is currently discussed
+ to replace the former by adding a compatibility layer.
+ This patch is subject to be removed, once python-magic from pypi (or an
+ equivalent alternative) is available.
+ Relevant discussions:
+ https://lists.debian.org/debian-python/2017/09/msg00008.html
+ https://lists.debian.org/debian-python/2017/09/msg00015.html
+ https://lists.debian.org/debian-python/2017/10/msg00021.html
+Author: Mathias Behrle <mathiasb at m9s.biz>
+Bug-Debian: https://bugs.debian.org/877849
+Forwarded: not-needed
+Last-Update: 2017-11-02
+
+--- /dev/null
++++ b/thirdparty/magic/magic.py
+@@ -0,0 +1,296 @@
++"""
++magic is a wrapper around the libmagic file identification library.
++
++See README for more information.
++
++Usage:
++
++>>> import magic
++>>> magic.from_file("testdata/test.pdf")
++'PDF document, version 1.2'
++>>> magic.from_file("testdata/test.pdf", mime=True)
++'application/pdf'
++>>> magic.from_buffer(open("testdata/test.pdf").read(1024))
++'PDF document, version 1.2'
++>>>
++
++
++"""
++
++import sys
++import glob
++import os.path
++import ctypes
++import ctypes.util
++import threading
++
++from ctypes import c_char_p, c_int, c_size_t, c_void_p
++
++
++class MagicException(Exception):
++    def __init__(self, message):
++        super(MagicException, self).__init__(message)
++        self.message = message
++
++
++class Magic:
++    """
++    Magic is a wrapper around the libmagic C library.
++
++    """
++
++    def __init__(self, mime=False, magic_file=None, mime_encoding=False,
++                 keep_going=False, uncompress=False):
++        """
++        Create a new libmagic wrapper.
++
++        mime - if True, mimetypes are returned instead of textual descriptions
++        mime_encoding - if True, codec is returned
++        magic_file - use a mime database other than the system default
++        keep_going - don't stop at the first match, keep going
++        uncompress - Try to look inside compressed files.
++        """
++        self.flags = MAGIC_NONE
++        if mime:
++            self.flags |= MAGIC_MIME
++        if mime_encoding:
++            self.flags |= MAGIC_MIME_ENCODING
++        if keep_going:
++            self.flags |= MAGIC_CONTINUE
++
++        if uncompress:
++            self.flags |= MAGIC_COMPRESS
++
++        self.cookie = magic_open(self.flags)
++        self.lock = threading.Lock()
++        
++        magic_load(self.cookie, magic_file)
++
++    def from_buffer(self, buf):
++        """
++        Identify the contents of `buf`
++        """
++        with self.lock:
++            try:
++                return maybe_decode(magic_buffer(self.cookie, buf))
++            except MagicException as e:
++                return self._handle509Bug(e)
++
++    def from_file(self, filename):
++        # raise FileNotFoundException or IOError if the file does not exist
++        with open(filename):
++            pass
++        with self.lock:
++            try:
++                return maybe_decode(magic_file(self.cookie, filename))
++            except MagicException as e:
++                return self._handle509Bug(e)
++
++    def _handle509Bug(self, e):
++        # libmagic 5.09 has a bug where it might fail to identify the
++        # mimetype of a file and returns null from magic_file (and
++        # likely _buffer), but also does not return an error message.
++        if e.message is None and (self.flags & MAGIC_MIME):
++            return "application/octet-stream"
++        else:
++            raise e
++        
++    def __del__(self):
++        # no _thread_check here because there can be no other
++        # references to this object at this point.
++
++        # during shutdown magic_close may have been cleared already so
++        # make sure it exists before using it.
++
++        # the self.cookie check should be unnecessary and was an
++        # incorrect fix for a threading problem, however I'm leaving
++        # it in because it's harmless and I'm slightly afraid to
++        # remove it.
++        if self.cookie and magic_close:
++            magic_close(self.cookie)
++            self.cookie = None
++
++_instances = {}
++
++def _get_magic_type(mime):
++    i = _instances.get(mime)
++    if i is None:
++        i = _instances[mime] = Magic(mime=mime)
++    return i
++
++def from_file(filename, mime=False):
++    """"
++    Accepts a filename and returns the detected filetype.  Return
++    value is the mimetype if mime=True, otherwise a human readable
++    name.
++
++    >>> magic.from_file("testdata/test.pdf", mime=True)
++    'application/pdf'
++    """
++    m = _get_magic_type(mime)
++    return m.from_file(filename)
++
++def from_buffer(buffer, mime=False):
++    """
++    Accepts a binary string and returns the detected filetype.  Return
++    value is the mimetype if mime=True, otherwise a human readable
++    name.
++
++    >>> magic.from_buffer(open("testdata/test.pdf").read(1024))
++    'PDF document, version 1.2'
++    """
++    m = _get_magic_type(mime)
++    return m.from_buffer(buffer)
++
++
++
++
++libmagic = None
++# Let's try to find magic or magic1
++dll = ctypes.util.find_library('magic') or ctypes.util.find_library('magic1') or ctypes.util.find_library('cygmagic-1')
++
++# This is necessary because find_library returns None if it doesn't find the library
++if dll:
++    libmagic = ctypes.CDLL(dll)
++
++if not libmagic or not libmagic._name:
++    windows_dlls = ['magic1.dll','cygmagic-1.dll']
++    platform_to_lib = {'darwin': ['/opt/local/lib/libmagic.dylib',
++                                  '/usr/local/lib/libmagic.dylib'] +
++                         # Assumes there will only be one version installed
++                         glob.glob('/usr/local/Cellar/libmagic/*/lib/libmagic.dylib'),
++                       'win32': windows_dlls,
++                       'cygwin': windows_dlls,
++                       'linux': ['libmagic.so.1'],    # fallback for some Linuxes (e.g. Alpine) where library search does not work
++                      }
++    platform = 'linux' if sys.platform.startswith('linux') else sys.platform
++    for dll in platform_to_lib.get(platform, []):
++        try:
++            libmagic = ctypes.CDLL(dll)
++            break
++        except OSError:
++            pass
++
++if not libmagic or not libmagic._name:
++    # It is better to raise an ImportError since we are importing magic module
++    raise ImportError('failed to find libmagic.  Check your installation')
++
++magic_t = ctypes.c_void_p
++
++def errorcheck_null(result, func, args):
++    if result is None:
++        err = magic_error(args[0])
++        raise MagicException(err)
++    else:
++        return result
++
++def errorcheck_negative_one(result, func, args):
++    if result is -1:
++        err = magic_error(args[0])
++        raise MagicException(err)
++    else:
++        return result
++
++
++# return str on python3.  Don't want to unconditionally
++# decode because that results in unicode on python2
++def maybe_decode(s):
++    if str == bytes:
++        return s
++    else:
++        return s.decode('utf-8')
++    
++def coerce_filename(filename):
++    if filename is None:
++        return None
++
++    # ctypes will implicitly convert unicode strings to bytes with
++    # .encode('ascii').  If you use the filesystem encoding 
++    # then you'll get inconsistent behavior (crashes) depending on the user's
++    # LANG environment variable
++    is_unicode = (sys.version_info[0] <= 2 and
++                  isinstance(filename, unicode)) or \
++                  (sys.version_info[0] >= 3 and
++                   isinstance(filename, str))
++    if is_unicode:
++        return filename.encode('utf-8')
++    else:
++        return filename
++
++magic_open = libmagic.magic_open
++magic_open.restype = magic_t
++magic_open.argtypes = [c_int]
++
++magic_close = libmagic.magic_close
++magic_close.restype = None
++magic_close.argtypes = [magic_t]
++
++magic_error = libmagic.magic_error
++magic_error.restype = c_char_p
++magic_error.argtypes = [magic_t]
++
++magic_errno = libmagic.magic_errno
++magic_errno.restype = c_int
++magic_errno.argtypes = [magic_t]
++
++_magic_file = libmagic.magic_file
++_magic_file.restype = c_char_p
++_magic_file.argtypes = [magic_t, c_char_p]
++_magic_file.errcheck = errorcheck_null
++
++def magic_file(cookie, filename):
++    return _magic_file(cookie, coerce_filename(filename))
++
++_magic_buffer = libmagic.magic_buffer
++_magic_buffer.restype = c_char_p
++_magic_buffer.argtypes = [magic_t, c_void_p, c_size_t]
++_magic_buffer.errcheck = errorcheck_null
++
++def magic_buffer(cookie, buf):
++    return _magic_buffer(cookie, buf, len(buf))
++
++
++_magic_load = libmagic.magic_load
++_magic_load.restype = c_int
++_magic_load.argtypes = [magic_t, c_char_p]
++_magic_load.errcheck = errorcheck_negative_one
++
++def magic_load(cookie, filename):
++    return _magic_load(cookie, coerce_filename(filename))
++
++magic_setflags = libmagic.magic_setflags
++magic_setflags.restype = c_int
++magic_setflags.argtypes = [magic_t, c_int]
++
++magic_check = libmagic.magic_check
++magic_check.restype = c_int
++magic_check.argtypes = [magic_t, c_char_p]
++
++magic_compile = libmagic.magic_compile
++magic_compile.restype = c_int
++magic_compile.argtypes = [magic_t, c_char_p]
++
++
++
++MAGIC_NONE = 0x000000 # No flags
++MAGIC_DEBUG = 0x000001 # Turn on debugging
++MAGIC_SYMLINK = 0x000002 # Follow symlinks
++MAGIC_COMPRESS = 0x000004 # Check inside compressed files
++MAGIC_DEVICES = 0x000008 # Look at the contents of devices
++MAGIC_MIME = 0x000010 # Return a mime string
++MAGIC_MIME_ENCODING = 0x000400 # Return the MIME encoding
++MAGIC_CONTINUE = 0x000020 # Return all matches
++MAGIC_CHECK = 0x000040 # Print warnings to stderr
++MAGIC_PRESERVE_ATIME = 0x000080 # Restore access time on exit
++MAGIC_RAW = 0x000100 # Don't translate unprintable chars
++MAGIC_ERROR = 0x000200 # Handle ENOENT etc as real errors
++
++MAGIC_NO_CHECK_COMPRESS = 0x001000 # Don't check for compressed files
++MAGIC_NO_CHECK_TAR = 0x002000 # Don't check for tar files
++MAGIC_NO_CHECK_SOFT = 0x004000 # Don't check magic entries
++MAGIC_NO_CHECK_APPTYPE = 0x008000 # Don't check application type
++MAGIC_NO_CHECK_ELF = 0x010000 # Don't check for elf details
++MAGIC_NO_CHECK_ASCII = 0x020000 # Don't check for ascii files
++MAGIC_NO_CHECK_TROFF = 0x040000 # Don't check ascii/troff
++MAGIC_NO_CHECK_FORTRAN = 0x080000 # Don't check ascii/fortran
++MAGIC_NO_CHECK_TOKENS = 0x100000 # Don't check ascii/tokens
+--- a/MANIFEST.in
++++ b/MANIFEST.in
+@@ -6,3 +6,4 @@
+ include relatorio/tests/*.odt
+ include relatorio/tests/*.png
+ include relatorio/tests/templates/*.tmpl
++include thirdparty/magic/*
+--- /dev/null
++++ b/thirdparty/__init__.py
+@@ -0,0 +1 @@
++# placeholder
+\ No newline at end of file
+--- /dev/null
++++ b/thirdparty/magic/__init__.py
+@@ -0,0 +1 @@
++# placeholder
+\ No newline at end of file
+--- a/relatorio/templates/opendocument.py
++++ b/relatorio/templates/opendocument.py
+@@ -873,7 +873,7 @@
+ 
+ def extract_images(child, namespaces, start=0):
+     "Extract draw:image with binary-data and replace by href"
+-    import magic
++    from thirdparty.magic import magic
+     images = []
+     for i, image in enumerate(
+             child.xpath('//draw:image', namespaces=namespaces), start):
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..3fa1687
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+01-add-pypi-magic.patch
commit 4167714f5841213ce96a22f05dd8f8dabfb64d71
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Nov 1 17:00:42 2017 +0100

    Merging 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
 
commit 5be402d9810a234949c51e446d5199b8ed5fb830
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Nov 1 16:54:41 2017 +0100

    Bump Standards-Version to 4.1.1, no changes needed.

diff --git a/debian/control b/debian/control
index a0cedd8..2a62a90 100644
--- a/debian/control
+++ b/debian/control
@@ -19,7 +19,7 @@ Build-Depends:
  python3-nose,
  python3-setuptools,
  python3-yaml,
-Standards-Version: 4.1.0
+Standards-Version: 4.1.1
 Homepage: http://relatorio.tryton.org/
 Vcs-Browser: https://anonscm.debian.org/cgit/tryton/relatorio.git
 Vcs-Git: https://anonscm.debian.org/cgit/tryton/relatorio.git
-- 
relatorio



More information about the tryton-debian-vcs mailing list