[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    l10n-support/pology/scripts
From:       Chusslove Illich <caslav.ilic () gmx ! net>
Date:       2008-12-31 18:01:56
Message-ID: 1230746516.701244.32503.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 903938 by ilic:

Better sorting of history. Beter determination of unascribed messages.

 M  +11 -5     poascribe.py  


--- trunk/l10n-support/pology/scripts/poascribe.py #903937:903938
@@ -937,13 +937,13 @@
     asc_append_field(amsg, _atype_rvv, modstr)
 
 
-def asc_eq (msg1, msg2):
+def asc_eq (msg1, msg2, ignfuzz=False):
     """
     Whether two messages are equal from the ascription viewpoint.
     """
 
     return (    True
-            and is_fuzzy(msg1) == is_fuzzy(msg2)
+            and (is_fuzzy(msg1) == is_fuzzy(msg2) or ignfuzz)
             and msg1.msgctxt == msg2.msgctxt
             and msg1.msgid == msg2.msgid
             and msg1.msgid_plural == msg2.msgid_plural
@@ -1041,6 +1041,11 @@
                 a.type, a.tag, a.date, a.rev = asc
                 history.append(a)
 
+    # Sort here and not at the end, as history after pivoting must
+    # logically be older, while due to different moments of modified/fuzzy
+    # ascription this may be procedurally violated.
+    history.sort(lambda x, y: asc_age_cmp(y, x, config))
+
     # Continue into the past by pivoting around fuzzy messages.
     acat = acats.get(UFUZZ)
     if acat and msg in acat:
@@ -1057,8 +1062,6 @@
         ct_history = asc_collect_history_w(pmsg, acats, config, seenmsg)
         history.extend(ct_history)
 
-    history.sort(lambda x, y: asc_age_cmp(y, x, config))
-
     return history
 
 
@@ -1272,13 +1275,16 @@
 
         if history:
             amsg = history[0].msg
-            if asc_eq(msg, amsg):
+            if asc_eq(msg, amsg, ignfuzz=True):
                 return True
             elif options.tfilter:
                 # Also consider ascribed if no difference from last ascription
                 # under the filter in effect.
                 if not msg.diff_from(amsg, pfilter=options.tfilter):
                     return True
+        elif not is_translated(msg):
+            # Also consider ascribed untranslated messages without history.
+            return True
 
         return None
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic