[tryton-debian-vcs] relatorio branch debian updated. debian/0.6.0-3-9-gf1ab099

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Fri Sep 12 16:58:21 UTC 2014


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.0-3-9-gf1ab099

commit f1ab09962cfdd7ab2168fc4869b37f72b7b12b1d
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Sep 12 18:57:59 2014 +0200

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

diff --git a/debian/changelog b/debian/changelog
index 2d3178c..8023d0c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+relatorio (0.6.1-1) unstable; urgency=medium
+
+  * Removing  LC_ALL=C.UTF-8 as build environment.
+  * Removing accidently doubled option pgpsigurlmangle from watch file.
+  * Updating signing key while using now plain .asc files instead of .pgp
+    binaries.
+  * Removing examples file, there are none.
+  * Updating gbp.conf for the usage of the tarball compression.
+  * Merging upstream version 0.6.1.
+  * Updating copyright.
+  * Enabling tests for Python2.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Fri, 12 Sep 2014 14:20:50 +0200
+
 relatorio (0.6.0-3) unstable; urgency=medium
 
   * Updating year in debian copyright.
commit d64324123e8b219ef6fefc6dc7b49640a6b2b51c
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Sep 12 14:20:07 2014 +0200

    Enabling tests for Python2.

diff --git a/debian/control b/debian/control
index 64765d4..77250b8 100644
--- a/debian/control
+++ b/debian/control
@@ -4,8 +4,8 @@ Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Mathias Behrle <mathiasb at m9s.biz>
 Build-Depends:
- debhelper (>= 9), python (>= 2.6.6-3~), python-genshi, python-setuptools,
- dh-python
+ debhelper (>= 9), python (>= 2.6.6-3~), dh-python,
+ python-setuptools, python-genshi, python-lxml, python-nose
 Standards-Version: 3.9.5
 Homepage: http://code.google.com/p/python-relatorio/
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=tryton/relatorio.git
diff --git a/debian/rules b/debian/rules
index 85a7802..08cbfef 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,9 +1,12 @@
 #!/usr/bin/make -f
 
-# Don't run tests, they try to download dependencies from pypi
-export PYBUILD_DISABLE_python2.7=test
+PACKAGE_NAME := $(shell python setup.py --name)
+export PYBUILD_NAME=$(PACKAGE_NAME)
 
 %:
 	dh ${@} --with python2 --buildsystem=pybuild
 
-
+override_dh_install:
+	dh_install
+	mkdir -p debian/python-relatorio/usr/share/python-relatorio
+	mv debian/python-relatorio/usr/lib/python2.7/dist-packages/relatorio/tests/ debian/python-relatorio/usr/share/python-relatorio
commit ff480e1721eea411f633ce6c90039bfd4b7626cf
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Sep 12 13:00:41 2014 +0200

    Updating copyright.

diff --git a/debian/copyright b/debian/copyright
index 01533cd..b3775c9 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -4,9 +4,29 @@ Files: *
 Copyright: 2007-2008 OpenHex SPRL <http://www.openhex.com/>
 License: GPL-3+
 
+Files: relatorio/templates/chart.py
+Copyright: 2007-2008 OpenHex SPRL <http://www.openhex.com/>
+           2014 Cedric Krier
+License: GPL-3+
+
 Files: relatorio/templates/opendocument.py
 Copyright: 2007-2008 OpenHex SPRL <http://www.openhex.com/>
-           2009-2013 Cedric Krier
+           2009-2014 Cedric Krier
+License: GPL-3+
+
+Files: relatorio/templates/pdf.py
+Copyright: 2007-2008 OpenHex SPRL <http://www.openhex.com/>
+           2014 Cedric Krier
+License: GPL-3+
+
+Files: relatorio/tests/test_api.py
+Copyright: 2007-2008 OpenHex SPRL <http://www.openhex.com/>
+           2014 Cedric Krier
+License: GPL-3+
+
+Files: relatorio/tests/test_odt.py
+Copyright: 2007-2008 OpenHex SPRL <http://www.openhex.com/>
+           2014 Cedric Krier
 License: GPL-3+
 
 Files: debian/*
commit 1ebe40891bf01cbd86789be562a17f4e56c5c3b9
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Sep 12 12:45:47 2014 +0200

    Merging upstream version 0.6.1.

diff --git a/CHANGES b/CHANGES
index 15bec1b..e1b9edd 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+0.6.1 - 20140909
+* Use io module instead of StringIO
+* Explicitly close ZipFile
+
 0.6.0 - 20130810
  * Add support for Python 3
  * Allow to pass only source to Template
diff --git a/PKG-INFO b/PKG-INFO
index e112e9f..e1723a7 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,8 +1,8 @@
 Metadata-Version: 1.1
 Name: relatorio
-Version: 0.6.0
+Version: 0.6.1
 Summary: A templating library able to output odt and pdf files
-Home-page: http://relatorio.openhex.org/
+Home-page: http://code.google.com/p/python-relatorio/
 Author: Cedric Krier
 Author-email: cedric.krier at b2ck.com
 License: GPL License
diff --git a/relatorio.egg-info/PKG-INFO b/relatorio.egg-info/PKG-INFO
index e112e9f..e1723a7 100644
--- a/relatorio.egg-info/PKG-INFO
+++ b/relatorio.egg-info/PKG-INFO
@@ -1,8 +1,8 @@
 Metadata-Version: 1.1
 Name: relatorio
-Version: 0.6.0
+Version: 0.6.1
 Summary: A templating library able to output odt and pdf files
-Home-page: http://relatorio.openhex.org/
+Home-page: http://code.google.com/p/python-relatorio/
 Author: Cedric Krier
 Author-email: cedric.krier at b2ck.com
 License: GPL License
diff --git a/relatorio/__init__.py b/relatorio/__init__.py
index 09888e1..34f35d1 100644
--- a/relatorio/__init__.py
+++ b/relatorio/__init__.py
@@ -9,7 +9,8 @@ easy: you just have to create a plugin for this.
 relatorio also provides a report repository allowing you to link python objects
 and report together, find reports by mimetypes/name/python objects.
 """
-from relatorio.reporting import MIMETemplateLoader, ReportRepository, Report
-import templates
+from .reporting import MIMETemplateLoader, ReportRepository, Report
+from . import templates
 
-__version__ = '0.6.0'
+__version__ = '0.6.1'
+__all__ = ['MIMETemplateLoader', 'ReportRepository', 'Report', 'templates']
diff --git a/relatorio/templates/__init__.py b/relatorio/templates/__init__.py
index a4bbb60..c514f00 100644
--- a/relatorio/templates/__init__.py
+++ b/relatorio/templates/__init__.py
@@ -18,26 +18,12 @@
 #
 ###############################################################################
 
-import traceback
 import warnings
-try:
-    from cStringIO import StringIO
-except ImportError:
-    from StringIO import StringIO
 
 plugins = ['base', 'opendocument', 'pdf', 'chart']
 
 for name in plugins:
     try:
         __import__('relatorio.templates.%s' % name)
-    except Exception, e:
-        tb_file = StringIO()
-
-        print >> tb_file, ("Unable to load plugin '%s', you will not be able "
-                           "to use it" % name)
-        print >> tb_file
-        print >> tb_file, 'Original traceback:'
-        print >> tb_file, '-------------------'
-        traceback.print_exc(file=tb_file)
-        print >> tb_file
-        warnings.warn(tb_file.getvalue())
+    except ImportError:
+        warnings.warn("Unable to load plugin '%s'" % name)
diff --git a/relatorio/templates/chart.py b/relatorio/templates/chart.py
index 34d0770..b937fd9 100644
--- a/relatorio/templates/chart.py
+++ b/relatorio/templates/chart.py
@@ -1,5 +1,6 @@
 ###############################################################################
 #
+# Copyright (c) 2014 Cedric Krier.
 # Copyright (c) 2007, 2008 OpenHex SPRL. (http://openhex.com) All Rights
 # Reserved.
 #
@@ -20,10 +21,7 @@
 
 __metaclass__ = type
 
-try:
-    from cStringIO import StringIO
-except ImportError:
-    from StringIO import StringIO
+from io import BytesIO
 
 import yaml
 import genshi
@@ -67,8 +65,8 @@ class CairoSerializer:
         self.text_serializer = genshi.output.TextSerializer()
 
     def __call__(self, stream):
-        result = StringIO()
-        yml = StringIO(_encode(self.text_serializer(stream)))
+        result = BytesIO()
+        yml = BytesIO(_encode(self.text_serializer(stream)))
         chart_yaml = yaml.load(yml.read())
         chart_info = chart_yaml['chart']
         chart_type = chart_info['output_type']
diff --git a/relatorio/templates/opendocument.py b/relatorio/templates/opendocument.py
index 159eff0..01e9778 100644
--- a/relatorio/templates/opendocument.py
+++ b/relatorio/templates/opendocument.py
@@ -1,6 +1,6 @@
 ###############################################################################
 #
-# Copyright (c) 2009-2013 Cedric Krier.
+# Copyright (c) 2009-2014 Cedric Krier.
 # Copyright (c) 2007, 2008 OpenHex SPRL. (http://openhex.com) All Rights
 # Reserved.
 #
@@ -31,13 +31,7 @@ except ImportError:
 import time
 import urllib
 import zipfile
-try:
-    from io import BytesIO
-except ImportError:
-    try:
-        from cStringIO import StringIO as BytesIO
-    except ImportError:
-        from StringIO import StringIO as BytesIO
+from io import BytesIO
 from copy import deepcopy
 import datetime
 from decimal import Decimal
@@ -225,7 +219,7 @@ def update_py_attrs(node, value):
     if not value:
         return
     py_attrs_attr = '{%s}attrs' % GENSHI_URI
-    if not py_attrs_attr in node.attrib:
+    if py_attrs_attr not in node.attrib:
         node.attrib[py_attrs_attr] = value
     else:
         node.attrib[py_attrs_attr] = \
@@ -240,7 +234,7 @@ class Template(MarkupTemplate):
         self.namespaces = {}
         self.inner_docs = []
         self.has_col_loop = False
-        self._zip_source = None
+        self._source = None
         super(Template, self).__init__(source, filepath, filename, loader,
                                        encoding, lookup, allow_exec)
 
@@ -261,7 +255,9 @@ class Template(MarkupTemplate):
                     source = BytesIO(source.read())
         else:
             source = self.filepath
-        self._zip_source = zf = zipfile.ZipFile(source)
+        self._source = source
+        self.filepath = None  # Prevent zip content in traceback
+        zf = zipfile.ZipFile(source)
         content = zf.read('content.xml')
         styles = zf.read('styles.xml')
 
@@ -283,6 +279,7 @@ class Template(MarkupTemplate):
                                        encoding)
             content_files.append((c_path, c_parsed))
             styles_files.append((s_path, s_parsed))
+        zf.close()
 
         parsed = []
         for fpath, fparsed in content_files + styles_files:
@@ -361,7 +358,7 @@ class Template(MarkupTemplate):
                 raise OOTemplateError("No expression in the tag",
                                       self.filepath)
             closing, directive, attr, attr_val = \
-                    GENSHI_EXPR.match(expr).groups()
+                GENSHI_EXPR.match(expr).groups()
             is_opening = closing != '/'
 
             warn_msg = None
@@ -436,7 +433,7 @@ class Template(MarkupTemplate):
                         pass
                     o_ancestors.append(node)
                 assert ancestor is not None, \
-                       "No common ancestor found for opening and closing tag"
+                    "No common ancestor found for opening and closing tag"
 
                 outermost_o_ancestor = o_ancestors[-1]
                 outermost_c_ancestor = c_ancestors[-1]
@@ -577,7 +574,7 @@ class Template(MarkupTemplate):
             for tag in to_split:
                 tag_pos = table_node.index(tag)
                 num = int(tag.attrib.pop(table_num_col_attr))
-                new_tags = [deepcopy(tag) for _ in range(num)]
+                new_tags = [deepcopy(tag) for i in range(num)]
                 table_node[tag_pos:tag_pos + 1] = new_tags
 
             # compute the column header nodes corresponding to
@@ -588,10 +585,10 @@ class Template(MarkupTemplate):
             # add a <relatorio:repeat> node around the column
             # definitions nodes
             attribs = {
-               "opening": str(opening_pos),
-               "closing": str(closing_pos),
-               "table": table_name
-            }
+                "opening": str(opening_pos),
+                "closing": str(closing_pos),
+                "table": table_name,
+                }
             repeat_node = EtreeElement(repeat_tag, attrib=attribs,
                                        nsmap={'relatorio': RELATORIO_URI})
             wrap_nodes_between(first, last, repeat_node)
@@ -707,7 +704,7 @@ class Template(MarkupTemplate):
 
     def generate(self, *args, **kwargs):
         "creates the RelatorioStream."
-        serializer = OOSerializer(self._zip_source)
+        serializer = OOSerializer(self._source)
         kwargs['__relatorio_make_href'] = ImageHref(serializer.outzip,
                                                     serializer.manifest,
                                                     kwargs)
@@ -812,7 +809,7 @@ class Meta(object):
         meta = self.office_meta.find('{%s}%s' % (namespace, name))
         if meta is None:
             meta = EtreeElement('{%s}%s' % (namespace, name),
-                                            nsmap={'meta': namespace})
+                                nsmap={'meta': namespace})
             self.office_meta.append(meta)
         meta.text = value
 
@@ -845,8 +842,8 @@ class Meta(object):
 
 class OOSerializer:
 
-    def __init__(self, inzip):
-        self.inzip = inzip
+    def __init__(self, source):
+        self.inzip = zipfile.ZipFile(source)
         self.manifest = Manifest(self.inzip.read(MANIFEST))
         self.meta = Meta(self.inzip.read(META))
         self.new_oo = BytesIO()
@@ -887,6 +884,7 @@ class OOSerializer:
         self.manifest.remove_file_entry(THUMBNAILS + '/')
         if manifest_info:
             self.outzip.writestr(manifest_info, str(self.manifest))
+        self.inzip.close()
         self.outzip.close()
 
         return self.new_oo
diff --git a/relatorio/templates/pdf.py b/relatorio/templates/pdf.py
index c99024c..f21945b 100644
--- a/relatorio/templates/pdf.py
+++ b/relatorio/templates/pdf.py
@@ -1,5 +1,6 @@
 ###############################################################################
 #
+# Copyright (c) 2014 Cedric Krier.
 # Copyright (c) 2007, 2008 OpenHex SPRL. (http://openhex.com) All Rights
 # Reserved.
 #
@@ -24,10 +25,7 @@ import os
 import shutil
 import tempfile
 import subprocess
-try:
-    from cStringIO import StringIO
-except ImportError:
-    from StringIO import StringIO
+from io import BytesIO
 
 import genshi
 import genshi.output
@@ -63,7 +61,7 @@ class PDFSerializer:
         subprocess.check_call([TEXEXEC, '--purge', 'report.tex'],
                               cwd=self.working_dir)
 
-        pdf = StringIO()
+        pdf = BytesIO()
         pdf.write(open(self.pdf_file, 'r').read())
 
         shutil.rmtree(self.working_dir, ignore_errors=True)
diff --git a/relatorio/tests/test_api.py b/relatorio/tests/test_api.py
index 11e8993..8f89762 100644
--- a/relatorio/tests/test_api.py
+++ b/relatorio/tests/test_api.py
@@ -1,5 +1,6 @@
 ###############################################################################
 #
+# Copyright (c) 2014 Cedric Krier.
 # Copyright (c) 2007, 2008 OpenHex SPRL. (http://openhex.com) All Rights
 # Reserved.
 #
@@ -20,7 +21,7 @@
 
 
 import os
-from nose.tools import *
+from nose.tools import assert_true, eq_, assert_raises
 
 from relatorio.reporting import (ReportRepository, Report, MIMETemplateLoader,
                                  DefaultFactory, _absolute, _guess_type)
diff --git a/relatorio/tests/test_odt.py b/relatorio/tests/test_odt.py
index 2d982ff..c665aad 100644
--- a/relatorio/tests/test_odt.py
+++ b/relatorio/tests/test_odt.py
@@ -1,6 +1,7 @@
 # -*- encoding: utf-8 -*-
 ###############################################################################
 #
+# Copyright (c) 2014 Cedric Krier.
 # Copyright (c) 2007, 2008 OpenHex SPRL. (http://openhex.com) All Rights
 # Reserved.
 #
@@ -21,13 +22,10 @@
 
 
 import os
-try:
-    from cStringIO import StringIO
-except ImportError:
-    from StringIO import StringIO
+from io import StringIO
 
 import lxml.etree
-from nose.tools import *
+from nose.tools import ok_, eq_, assert_raises
 from genshi.filters import Translator
 from genshi.core import PI
 from genshi.template.eval import UndefinedError
@@ -42,16 +40,17 @@ def pseudo_gettext(string):
     catalog = {'Mes collègues sont:': 'My colleagues are:',
                'Bonjour,': 'Hello,',
                'Je suis un test de templating en odt.':
-                'I am an odt templating test',
+               'I am an odt templating test',
                'Felix da housecat': u'Félix le chat de la maison',
                'We sell stuff': u'On vend des choses',
               }
     return catalog.get(string, string)
 
+
 def stream_to_string(stream):
     # In Python 3, stream will be bytes
-    if not isinstance(stream, str):
-        return str(stream, 'utf-8')
+    if not isinstance(stream, unicode):
+        return unicode(stream, 'utf-8')
     return stream
 
 
@@ -254,7 +253,7 @@ class TestOOTemplating(object):
         rendered = stream_to_string(stream.events.render(encoding='utf-8'))
         ok_('Bonjour,' in rendered)
         ok_('Trente' in rendered)
-        ok_('Møller' in rendered)
+        ok_(u'Møller' in rendered)
         ok_('Dog eat Dog' in rendered)
         ok_('Felix da housecat' in rendered)
 
@@ -267,7 +266,7 @@ class TestOOTemplating(object):
         ok_("Hello," in translated_xml)
         ok_("I am an odt templating test" in translated_xml)
         ok_('Felix da housecat' not in translated_xml)
-        ok_('Félix le chat de la maison' in translated_xml)
+        ok_(u'Félix le chat de la maison' in translated_xml)
         ok_('We sell stuff' not in translated_xml)
         ok_('On vend des choses' in translated_xml)
 
diff --git a/setup.py b/setup.py
index f342bf6..a0052a6 100644
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,7 @@ import os
 import re
 from setuptools import setup, find_packages
 
+
 def get_version():
     init = open(os.path.join(os.path.dirname(__file__), 'relatorio',
                              '__init__.py')).read()
@@ -9,9 +10,9 @@ def get_version():
 
 setup(
     name="relatorio",
-    url="http://relatorio.openhex.org/",
+    url="http://code.google.com/p/python-relatorio/",
     author="Nicolas Evrard",
-    author_email="nicoe at openhex.org",
+    author_email="nicolas.evrard at b2ck.com",
     maintainer="Cedric Krier",
     maintainer_email="cedric.krier at b2ck.com",
     description="A templating library able to output odt and pdf files",
-- 
relatorio



More information about the tryton-debian-vcs mailing list