From 13611bff01e7054cc5e6b4952f28b6dc0664a45b Mon Sep 17 00:00:00 2001 From: duplo Date: Wed, 22 Apr 2009 08:23:00 +0000 Subject: [PATCH] Change the registry importer module git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2613 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/winreg_importer.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/wizard/winreg_importer.py b/wizard/winreg_importer.py index 2030934e..1d713547 100644 --- a/wizard/winreg_importer.py +++ b/wizard/winreg_importer.py @@ -22,30 +22,41 @@ try: except WindowsError: TOOLCHAIN_KEY = None +try: + CLI_KEY = OpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Develer\BeRTOS SDK\Command Lines") +except WindowsError: + CLI_KEY = None + def getBertosDirs(): """ Returns the path of the BeRTOS versions installed by the BeRTOS SDK installer. """ - return getFromRegistry(DIR_KEY) + return getFromRegistry(DIR_KEY).values() def getBertosToolchains(): """ Returns the path of the executables of the toolchains installed by the BeRTOS SDK installer. """ - return getFromRegistry(TOOLCHAIN_KEY) + return getFromRegistry(TOOLCHAIN_KEY).values() + +def getCommandLines(): + """ + Returns the command lines to launch in order to open the selected IDE. + """ + return getFromRegistry(CLI_KEY) def getFromRegistry(key): """ Returns the value of all the named values of the given key. """ index = 0 - items = [] + items = {} if key: while True: try: - item = EnumValue(key, index)[1] - items.append(item) + item = EnumValue(key, index) + items[item[0]] = item[1] index += 1 except WindowsError: break -- 2.25.1