from _winreg import *\r
\r
DIR_KEY = OpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Develer\BeRTOS SDK\BeRTOS Dirs")\r
+TOOLCHAIN_KEY = OpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Develer\BeRTOS SDK\Toolchain Executables")\r
\r
def getBertosDirs():\r
+ """\r
+ Returns the path of the BeRTOS versions installed by the BeRTOS SDK installer.\r
+ """\r
+ return getFromRegistry(DIR_KEY)\r
+\r
+def getBertosToolchain():\r
+ """\r
+ Returns the path of the executables of the toolchains installed by the BeRTOS\r
+ SDK installer.\r
+ """\r
+ return getFromRegistry(TOOLCHAIN_KEY)\r
+\r
+def getFromRegistry(key):\r
+ """\r
+ Returns the value of all the named values of the given key.\r
+ """\r
index = 0\r
- dirs = []\r
+ items = []\r
while True:\r
try:\r
- dir = EnumValue(DIR_KEY, index)[1]\r
- dirs.append(dir)\r
- index += 1\r
+ item = EnumValue(TOOLCHAIN_KEY, index)[1]\r
+ items.append(item)\r
except WindowsError:\r
break\r
- return dirs\r
-
\ No newline at end of file
+ return items
\ No newline at end of file