# This file is required to make Python interpreter treat the directory\r
# as containing package.\r
#\r
-# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
@classmethod\r
def handleWsMacro(cls, PathStr):\r
if TAB_WORKSPACE in PathStr:\r
- Path = PathStr.replace(TAB_WORKSPACE, cls.WORKSPACE).strip()\r
- if not os.path.exists(Path):\r
- for Pkg in cls.PACKAGES_PATH:\r
- Path = PathStr.replace(TAB_WORKSPACE, Pkg).strip()\r
- if os.path.exists(Path):\r
- return Path\r
+ PathList = PathStr.split()\r
+ if PathList:\r
+ for i, str in enumerate(PathList):\r
+ MacroStartPos = str.find(TAB_WORKSPACE)\r
+ if MacroStartPos != -1:\r
+ Substr = str[MacroStartPos:]\r
+ Path = Substr.replace(TAB_WORKSPACE, cls.WORKSPACE).strip()\r
+ if not os.path.exists(Path):\r
+ for Pkg in cls.PACKAGES_PATH:\r
+ Path = Substr.replace(TAB_WORKSPACE, Pkg).strip()\r
+ if os.path.exists(Path):\r
+ break\r
+ PathList[i] = str[0:MacroStartPos] + Path\r
+ PathStr = ' '.join(PathList)\r
return PathStr\r
\r
## getPkgPath()\r