_cmp use name if order is the same.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 24 May 2010 14:24:44 +0000 (14:24 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 24 May 2010 14:24:44 +0000 (14:24 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3810 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py

index 465808aaf657fb26f28240a7e85f44083f6c93e2..e361b3c446ec5ebc212c1d7dee71a68b822ed912 100644 (file)
@@ -52,7 +52,13 @@ from _wizard_version import WIZARD_VERSION
 from LoadException import VersionException, ToolchainException
 
 def _cmp(x, y):
-    return cmp(x["info"].get('ord', 0), y["info"].get('ord', 0))
+    result = cmp(x["info"].get('ord', 0), y["info"].get('ord', 0))
+    if result == 0:
+        result = cmp(
+            x["info"].get("name", x["info"]["filename"]).lower(),
+            y["info"].get("name", y["info"]["filename"]).lower()
+        )
+    return result
 
 def isBertosDir(directory):
    return os.path.exists(directory + "/VERSION")