From: duplo Date: Mon, 24 May 2010 14:24:44 +0000 (+0000) Subject: _cmp use name if order is the same. X-Git-Tag: 2.5.0~107 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=7ab0db65df07943ccdac8fce7e35c360767033ff;p=bertos.git _cmp use name if order is the same. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3810 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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")