X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FMultipleWorkspace.py;h=81594e22cd9feaf746950101148446aec43bd816;hp=2a76d49cc627ad6cd96ceef1818cb2a7d215f184;hb=f7496d717357b9af78414d19679b073403812340;hpb=39456d00f36e04b7e7efb208f350f4e83b6c3531 diff --git a/BaseTools/Source/Python/Common/MultipleWorkspace.py b/BaseTools/Source/Python/Common/MultipleWorkspace.py index 2a76d49cc6..81594e22cd 100644 --- a/BaseTools/Source/Python/Common/MultipleWorkspace.py +++ b/BaseTools/Source/Python/Common/MultipleWorkspace.py @@ -4,7 +4,7 @@ # This file is required to make Python interpreter treat the directory # as containing package. # -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -20,16 +20,16 @@ from Common.DataType import TAB_WORKSPACE ## MultipleWorkspace # # This class manage multiple workspace behavior -# +# # @param class: # # @var WORKSPACE: defined the current WORKSPACE # @var PACKAGES_PATH: defined the other WORKSAPCE, if current WORKSPACE is invalid, search valid WORKSPACE from PACKAGES_PATH -# +# class MultipleWorkspace(object): WORKSPACE = '' PACKAGES_PATH = None - + ## convertPackagePath() # # Convert path to match workspace. @@ -59,7 +59,7 @@ class MultipleWorkspace(object): cls.PACKAGES_PATH = [cls.convertPackagePath (Ws, os.path.normpath(Path.strip())) for Path in PackagesPath.split(os.pathsep)] else: cls.PACKAGES_PATH = [] - + ## join() # # rewrite os.path.join function @@ -79,7 +79,7 @@ class MultipleWorkspace(object): return Path Path = os.path.join(Ws, *p) return Path - + ## relpath() # # rewrite os.path.relpath function @@ -98,7 +98,7 @@ class MultipleWorkspace(object): if Path.lower().startswith(Ws.lower()): Path = os.path.relpath(Path, Ws) return Path - + ## getWs() # # get valid workspace for the path @@ -117,7 +117,7 @@ class MultipleWorkspace(object): if os.path.exists(absPath): return Pkg return Ws - + ## handleWsMacro() # # handle the $(WORKSPACE) tag, if current workspace is invalid path relative the tool, replace it. @@ -143,7 +143,7 @@ class MultipleWorkspace(object): PathList[i] = str[0:MacroStartPos] + Path PathStr = ' '.join(PathList) return PathStr - + ## getPkgPath() # # get all package pathes. @@ -153,4 +153,4 @@ class MultipleWorkspace(object): @classmethod def getPkgPath(cls): return cls.PACKAGES_PATH - \ No newline at end of file +