[Python-modules-commits] [xhtml2pdf] 05/13: create Ignore-turbogears.patch to handle missing turbogears

Drew Parsons dparsons at moszumanska.debian.org
Mon Oct 30 04:27:16 UTC 2017


This is an automated email from the git hooks/post-receive script.

dparsons pushed a commit to branch master
in repository xhtml2pdf.

commit 20ed81790c54a9f938a16410ec776799a91c6e34
Author: Drew Parsons <dparsons at emerall.com>
Date:   Mon Oct 30 10:57:49 2017 +0800

    create Ignore-turbogears.patch to handle missing turbogears
    
    There is some inconsistency in the turbogears api and the way that
    xhtml2pdf wants to use it.  The turbogears module is "tg", but
    xhtml2pdf attempts to import "turbogears". To make things worse, tg is
    not currently available in python3.
    
    Work around unavailability of turbogears by creating a dummy version
    of the function (turbogears.decorator.weak_signature_decorator) that
    xhtml2pdf is trying to access.
    
    turbogears is a specialised functionality, so the workaround is not
    expected to prevent the remainder of turbogears from functioning
    properly.
---
 debian/control                         |  3 ++-
 debian/patches/Ignore-turbogears.patch | 19 +++++++++++++++++++
 debian/patches/series                  |  1 +
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index bf593fa..04bae66 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,8 @@ Build-Depends-Indep: dh-python,
     python-all, python-setuptools,
     python3-all, python3-setuptools,
     python-pypdf2 (>= 1.26), python3-pypdf2 (>= 1.26),
-    python-html5lib (>= 0.999999999), python3-html5lib (>= 0.999999999)
+    python-html5lib (>= 0.999999999), python3-html5lib (>= 0.999999999),
+    python-turbogears2
 Standards-Version: 4.1.1
 Homepage: https://github.com/xhtml2pdf/xhtml2pdf
 Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/xhtml2pdf.git
diff --git a/debian/patches/Ignore-turbogears.patch b/debian/patches/Ignore-turbogears.patch
new file mode 100644
index 0000000..5000f88
--- /dev/null
+++ b/debian/patches/Ignore-turbogears.patch
@@ -0,0 +1,19 @@
+Index: xhtml2pdf/xhtml2pdf/turbogears.py
+===================================================================
+--- xhtml2pdf.orig/xhtml2pdf/turbogears.py
++++ xhtml2pdf/xhtml2pdf/turbogears.py
+@@ -14,7 +14,13 @@
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ 
+-from turbogears.decorator import weak_signature_decorator
++try:
++    from turbogears.decorator import weak_signature_decorator
++except:
++    def weak_signature_decorator(e):
++        print ("turbogears is not supported")
++        return Null
++
+ import xhtml2pdf.pisa as pisa
+ from six import StringIO
+ import cherrypy
diff --git a/debian/patches/series b/debian/patches/series
index 69f10be..222d837 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 Fix-path-to-interpreter.patch
 Fix-interpreter-path-to-please-lintian.patch
 Allow-html5lib-0.999999999.patch
+Ignore-turbogears.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/xhtml2pdf.git



More information about the Python-modules-commits mailing list