[Python-modules-commits] r23087 - in packages/sphinx/trunk/debian (3 files)

mitya57-guest at users.alioth.debian.org mitya57-guest at users.alioth.debian.org
Tue Nov 27 14:15:14 UTC 2012


    Date: Tuesday, November 27, 2012 @ 14:15:12
  Author: mitya57-guest
Revision: 23087

fix_l10n_footnotes.diff: add fix for external links, rename to l10n_fixes.diff

Added:
  packages/sphinx/trunk/debian/patches/l10n_fixes.diff
    (from rev 23086, packages/sphinx/trunk/debian/patches/fix_l10n_footnotes.diff)
Modified:
  packages/sphinx/trunk/debian/changelog
Deleted:
  packages/sphinx/trunk/debian/patches/fix_l10n_footnotes.diff

Modified: packages/sphinx/trunk/debian/changelog
===================================================================
--- packages/sphinx/trunk/debian/changelog	2012-11-27 05:16:01 UTC (rev 23086)
+++ packages/sphinx/trunk/debian/changelog	2012-11-27 14:15:12 UTC (rev 23087)
@@ -5,8 +5,8 @@
   * Bump standards version to 3.9.4; no changes needed.
 
   [ Dmitry Shachnev ]
-  * debian/patches/fix_l10n_footnotes.diff: Fix building HTML with footnotes
-    when using l10n (closes: #691719).
+  * debian/patches/l10n_fixes.diff: fix crashes and not working external
+    links in l10n mode (closes: #691719).
 
  -- Jakub Wilk <jwilk at debian.org>  Tue, 13 Nov 2012 22:36:10 +0100
 

Deleted: packages/sphinx/trunk/debian/patches/fix_l10n_footnotes.diff
===================================================================
--- packages/sphinx/trunk/debian/patches/fix_l10n_footnotes.diff	2012-11-27 05:16:01 UTC (rev 23086)
+++ packages/sphinx/trunk/debian/patches/fix_l10n_footnotes.diff	2012-11-27 14:15:12 UTC (rev 23087)
@@ -1,44 +0,0 @@
-Description: Fix l10n build of text containing footnotes
- Based on initial patch by Cristophe Simonis and modifications by Takayuki Shimizukawa
- (upstream pull request #86).
-Bug: https://bitbucket.org/birkenfeld/sphinx/issue/955/cant-build-html-with-footnotes-when-using
-Bug-Debian: http://bugs.debian.org/691719
-Author: Christophe Simonis <simonis.christophe at gmail.com>
-Last-Update: 2012-11-25
-
-=== modified file 'sphinx/environment.py'
---- a/sphinx/environment.py	2012-03-12 12:18:37 +0000
-+++ b/sphinx/environment.py	2012-11-23 14:18:39 +0000
-@@ -213,16 +213,30 @@
-         parser = RSTParser()
- 
-         for node, msg in extract_messages(self.document):
--            patch = new_document(source, settings)
-             msgstr = catalog.gettext(msg)
-             # XXX add marker to untranslated parts
-             if not msgstr or msgstr == msg: # as-of-yet untranslated
-                 continue
-+
-+            patch = new_document(source, settings)
-             parser.parse(msgstr, patch)
-             patch = patch[0]
-             # XXX doctest and other block markup
-             if not isinstance(patch, nodes.paragraph):
-                 continue # skip for now
-+
-+            footnote_refs = [r for r in node.children
-+                             if isinstance(r, nodes.footnote_reference)
-+                             and r.get('auto') == 1]
-+            for i, child in enumerate(patch.children): # update leaves
-+                if isinstance(child, nodes.footnote_reference) \
-+                   and child.get('auto') == 1:
-+                    # use original 'footnote_reference' object.
-+                    # this object already registered in self.document.autofootnote_refs
-+                    patch.children[i] = footnote_refs.pop(0)
-+                    # Some duplicated footnote_reference in msgstr causes
-+                    # IndexError by .pop(0). That is invalid msgstr.
-+
-             for child in patch.children: # update leaves
-                 child.parent = node
-             node.children = patch.children
-

Copied: packages/sphinx/trunk/debian/patches/l10n_fixes.diff (from rev 23086, packages/sphinx/trunk/debian/patches/fix_l10n_footnotes.diff)
===================================================================
--- packages/sphinx/trunk/debian/patches/l10n_fixes.diff	                        (rev 0)
+++ packages/sphinx/trunk/debian/patches/l10n_fixes.diff	2012-11-27 14:15:12 UTC (rev 23087)
@@ -0,0 +1,58 @@
+Description: Fix l10n build of text containing footnotes
+ Based on initial patch by Cristophe Simonis and modifications by Takayuki Shimizukawa
+ (upstream pull request #86).
+Bug: https://bitbucket.org/birkenfeld/sphinx/issue/955/cant-build-html-with-footnotes-when-using
+Bug-Debian: http://bugs.debian.org/691719
+Author: Takayuki Shimizukawa <shimizukawa at gmail.com>
+Last-Update: 2012-11-27
+
+=== modified file 'sphinx/environment.py'
+--- a/sphinx/environment.py	2012-03-12 12:18:37 +0000
++++ b/sphinx/environment.py	2012-11-27 14:05:36 +0000
+@@ -213,16 +213,44 @@
+         parser = RSTParser()
+ 
+         for node, msg in extract_messages(self.document):
+-            patch = new_document(source, settings)
+             msgstr = catalog.gettext(msg)
+             # XXX add marker to untranslated parts
+             if not msgstr or msgstr == msg: # as-of-yet untranslated
+                 continue
++
++            patch = new_document(source, settings)
+             parser.parse(msgstr, patch)
+             patch = patch[0]
+             # XXX doctest and other block markup
+             if not isinstance(patch, nodes.paragraph):
+                 continue # skip for now
++
++            footnote_refs = [r for r in node.children
++                             if isinstance(r, nodes.footnote_reference)
++                             and r.get('auto') == 1]
++            refs = [r for r in node.children if isinstance(r, nodes.reference)]
++
++            for i, child in enumerate(patch.children): # update leaves
++                if isinstance(child, nodes.footnote_reference) \
++                   and child.get('auto') == 1:
++                    # use original 'footnote_reference' object.
++                    # this object is already registered in self.document.autofootnote_refs
++                    patch.children[i] = footnote_refs.pop(0)
++                    # Some duplicated footnote_reference in msgstr causes
++                    # IndexError in .pop(0). That is invalid msgstr.
++
++                elif isinstance(child, nodes.reference):
++                    # reference should use original 'refname'.
++                    # * reference target ".. _Python: ..." is not translatable.
++                    # * section refname is not translatable.
++                    # * inline reference "`Python <...>`_" has no 'refname'.
++                    if refs and 'refname' in refs[0]:
++                        refname = child['refname'] = refs.pop(0)['refname']
++                        self.document.refnames.setdefault(
++                                refname, []).append(child)
++                    # if number of reference nodes had been changed, that
++                    # would often generate unknown link target warning.
++
+             for child in patch.children: # update leaves
+                 child.parent = node
+             node.children = patch.children
+




More information about the Python-modules-commits mailing list