summaryrefslogtreecommitdiff
path: root/community/python2-rst2pdf/rst2pdf-0.16_docutils-0.8.patch
blob: a7cc081ff8fa6e896f1f5ea2c3eab5927eaaadab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Index: rst2pdf/createpdf.py
===================================================================
--- rst2pdf/createpdf.py	(revision 2441)
+++ rst2pdf/createpdf.py	(working copy)
@@ -56,6 +56,7 @@
 from optparse import OptionParser
 import logging
 
+import docutils
 from docutils.languages import get_language
 import docutils.readers.doctree
 import docutils.core
@@ -97,6 +98,12 @@
 escape=tenjin.helpers.escape
 templateEngine=tenjin.Engine()
 
+# fix get_language for docutils>=0.8
+if docutils.__version__ >= '0.8':
+    orig_func = get_language
+    def get_language(arg1):
+        return orig_func(arg1, None)
+
 def renderTemplate(tname, **context):
   context['to_str']=to_str
   context['escape']=escape
Index: rst2pdf/pdfbuilder.py
===================================================================
--- rst2pdf/pdfbuilder.py	(revision 2441)
+++ rst2pdf/pdfbuilder.py	(working copy)
@@ -27,6 +27,7 @@
 from rst2pdf import pygments_code_block_directive, oddeven_directive
 from pygments.lexers import get_lexer_by_name, guess_lexer
 
+import docutils
 from docutils import writers
 from docutils import nodes
 from docutils import languages
@@ -56,7 +57,14 @@
 
 from traceback import print_exc
 
+# fix get_language for docutils>=0.8
+if docutils.__version__ >= '0.8':
+    orig_func = get_language
+    def get_language(arg1):
+        return orig_func(arg1, None)
+    languages.get_language = get_language
 
+
 class PDFBuilder(Builder):
     name = 'pdf'
     out_suffix = '.pdf'