From 7ab0db65df07943ccdac8fce7e35c360767033ff Mon Sep 17 00:00:00 2001 From: duplo Date: Mon, 24 May 2010 14:24:44 +0000 Subject: [PATCH] _cmp use name if order is the same. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3810 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos_utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 465808aa..e361b3c4 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -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") -- 2.25.1