[Debian-l10n-commits] r1723 - in /translate-toolkit/trunk/debian: changelog patches/deepcopy_bug870 patches/series

nekral-guest at users.alioth.debian.org nekral-guest at users.alioth.debian.org
Fri May 22 18:02:32 UTC 2009


Author: nekral-guest
Date: Fri May 22 18:02:31 2009
New Revision: 1723

URL: http://svn.debian.org/wsvn/?sc=1&rev=1723
Log:
  * debian/patches/deepcopy_bug870: Added upstream patch to fix suggestions.
    Closes: #523568

Added:
    translate-toolkit/trunk/debian/patches/deepcopy_bug870
Modified:
    translate-toolkit/trunk/debian/changelog
    translate-toolkit/trunk/debian/patches/series

Modified: translate-toolkit/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/translate-toolkit/trunk/debian/changelog?rev=1723&op=diff
==============================================================================
--- translate-toolkit/trunk/debian/changelog (original)
+++ translate-toolkit/trunk/debian/changelog Fri May 22 18:02:31 2009
@@ -2,8 +2,10 @@
 
   * debian/rules: Install the lintian override file with dh_lintian
   * debian/control, debian/compat: dh_lintian requires debhelper 6.0.7
-
- -- Nicolas FRANCOIS (Nekral) <nicolas.francois at centraliens.net>  Fri, 22 May 2009 18:24:18 +0200
+  * debian/patches/deepcopy_bug870: Added upstream patch to fix suggestions.
+    Closes: #523568
+
+ -- Nicolas FRANCOIS (Nekral) <nicolas.francois at centraliens.net>  Fri, 22 May 2009 20:02:09 +0200
 
 translate-toolkit (1.3.0-4) unstable; urgency=low
 

Added: translate-toolkit/trunk/debian/patches/deepcopy_bug870
URL: http://svn.debian.org/wsvn/translate-toolkit/trunk/debian/patches/deepcopy_bug870?rev=1723&op=file
==============================================================================
--- translate-toolkit/trunk/debian/patches/deepcopy_bug870 (added)
+++ translate-toolkit/trunk/debian/patches/deepcopy_bug870 Fri May 22 18:02:31 2009
@@ -1,0 +1,59 @@
+Goal: Fix failure during suggestion
+
+Fixes: 523568
+
+Status wrt upstream: Already applied upstream.
+http://bugs.locamotion.org/show_bug.cgi?id=870
+
+--- a/translate/lang/common.py
++++ b/translate/lang/common.py
+@@ -197,6 +197,10 @@
+             pass
+         return language
+ 
++    def __deepcopy__(self, memo={}):
++        memo[id(self)] = self
++        return self
++
+     def __repr__(self):
+         """Give a simple string representation without address information to 
+         be able to store it in text for comparison later."""
+--- a/translate/storage/pypo.py
++++ b/translate/storage/pypo.py
+@@ -150,6 +150,10 @@
+     # msgid = []
+     # msgstr = []
+ 
++    # Our homegrown way to indicate what must be copied in a shallow
++    # fashion
++    __shallow__ = ['_store']
++
+     def __init__(self, source=None, encoding="UTF-8"):
+         self._encoding = encodingToUse(encoding)
+         self.obsolete = False
+@@ -314,6 +318,25 @@
+         """Remove all the translator's notes (other comments)"""
+         self.othercomments = []
+ 
++    def __deepcopy__(self, memo={}):
++        # Make an instance to serve as the copy
++        new_unit = self.__class__()
++        # We'll be testing membership frequently, so make a set from
++        # self.__shallow__
++        shallow = set(self.__shallow__)
++        # Make deep copies of all members which are not in shallow
++        for key, value in self.__dict__.iteritems():
++            if key not in shallow:
++                setattr(new_unit, key, copy.deepcopy(value))
++        # Make shallow copies of all members which are in shallow
++        for key in set(shallow):
++            setattr(new_unit, key, getattr(self, key))
++        # Mark memo with ourself, so that we won't get deep copied
++        # again
++        memo[id(self)] = self
++        # Return our copied unit
++        return new_unit
++
+     def copy(self):
+         return copy.deepcopy(self)
+ 

Modified: translate-toolkit/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/translate-toolkit/trunk/debian/patches/series?rev=1723&op=diff
==============================================================================
--- translate-toolkit/trunk/debian/patches/series (original)
+++ translate-toolkit/trunk/debian/patches/series Fri May 22 18:02:31 2009
@@ -3,3 +3,4 @@
 API-doc-in-separate-package
 test_optrecurse-typo
 storage_bzr
+deepcopy_bug870




More information about the Debian-l10n-commits mailing list