[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56174] trunk/blender/release/scripts/ modules/bl_i18n_utils: Restore usage of difflib's quick_ratio()...

Bastien Montagne montagne29 at wanadoo.fr
Fri Apr 19 18:23:02 CEST 2013


Revision: 56174
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56174
Author:   mont29
Date:     2013-04-19 16:23:02 +0000 (Fri, 19 Apr 2013)
Log Message:
-----------
Restore usage of difflib's quick_ratio()... Don't actually know what happens here, my tests with timeit showed it much slower than ratio(), but real-life says the contrary...

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py	2013-04-19 15:53:24 UTC (rev 56173)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py	2013-04-19 16:23:02 UTC (rev 56174)
@@ -344,6 +344,7 @@
     "Temp. Diff.",
     "Float Neg. Exp.",
     "    RNA Path: bpy.types.",
+    "Max Ext.",
 }
 
 PARSER_CACHE_HASH = 'sha1'

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py	2013-04-19 15:53:24 UTC (rev 56173)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py	2013-04-19 16:23:02 UTC (rev 56174)
@@ -68,9 +68,7 @@
     for x in similar_pool:
         if min_len < len(x) < max_len:
             s.set_seq1(x)
-            # XXX quick_ratio() actually looks much slower (~400%) than ratio() itself!!!
-            #if s.real_quick_ratio() >= use_similar and s.quick_ratio() >= use_similar:
-            if s.real_quick_ratio() >= use_similar:
+            if s.real_quick_ratio() >= use_similar and s.quick_ratio() >= use_similar:
                 sratio = s.ratio()
                 if sratio >= use_similar:
                     tmp = x




More information about the Bf-blender-cvs mailing list