# This file is required to make Python interpreter treat the directory\r
# as containing package.\r
#\r
-# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2015 - 2018, 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
## MultipleWorkspace\r
#\r
# This class manage multiple workspace behavior\r
-# \r
+#\r
# @param class:\r
#\r
# @var WORKSPACE: defined the current WORKSPACE\r
# @var PACKAGES_PATH: defined the other WORKSAPCE, if current WORKSPACE is invalid, search valid WORKSPACE from PACKAGES_PATH\r
-# \r
+#\r
class MultipleWorkspace(object):\r
WORKSPACE = ''\r
PACKAGES_PATH = None\r
- \r
+\r
## convertPackagePath()\r
#\r
# Convert path to match workspace.\r
cls.PACKAGES_PATH = [cls.convertPackagePath (Ws, os.path.normpath(Path.strip())) for Path in PackagesPath.split(os.pathsep)]\r
else:\r
cls.PACKAGES_PATH = []\r
- \r
+\r
## join()\r
#\r
# rewrite os.path.join function\r
return Path\r
Path = os.path.join(Ws, *p)\r
return Path\r
- \r
+\r
## relpath()\r
#\r
# rewrite os.path.relpath function\r
if Path.lower().startswith(Ws.lower()):\r
Path = os.path.relpath(Path, Ws)\r
return Path\r
- \r
+\r
## getWs()\r
#\r
# get valid workspace for the path\r
if os.path.exists(absPath):\r
return Pkg\r
return Ws\r
- \r
+\r
## handleWsMacro()\r
#\r
# handle the $(WORKSPACE) tag, if current workspace is invalid path relative the tool, replace it.\r
PathList[i] = str[0:MacroStartPos] + Path\r
PathStr = ' '.join(PathList)\r
return PathStr\r
- \r
+\r
## getPkgPath()\r
#\r
# get all package pathes.\r
@classmethod\r
def getPkgPath(cls):\r
return cls.PACKAGES_PATH\r
-
\ No newline at end of file
+\r