本文整理汇总了Python中Common.MultipleWorkspace.MultipleWorkspace.relpath方法的典型用法代码示例。如果您正苦于以下问题:Python MultipleWorkspace.relpath方法的具体用法?Python MultipleWorkspace.relpath怎么用?Python MultipleWorkspace.relpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common.MultipleWorkspace.MultipleWorkspace
的用法示例。
在下文中一共展示了MultipleWorkspace.relpath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from Common.MultipleWorkspace import MultipleWorkspace [as 别名]
# 或者: from Common.MultipleWorkspace.MultipleWorkspace import relpath [as 别名]
def main():
global Options
Options = myOptionParser()
global Workspace
Workspace = ""
ArchList = None
ReturnCode = 0
EdkLogger.Initialize()
try:
if Options.verbose != None:
EdkLogger.SetLevel(EdkLogger.VERBOSE)
GenFdsGlobalVariable.VerboseMode = True
if Options.FixedAddress != None:
GenFdsGlobalVariable.FixedLoadAddress = True
if Options.quiet != None:
EdkLogger.SetLevel(EdkLogger.QUIET)
if Options.debug != None:
EdkLogger.SetLevel(Options.debug + 1)
GenFdsGlobalVariable.DebugLevel = Options.debug
else:
EdkLogger.SetLevel(EdkLogger.INFO)
if (Options.Workspace == None):
EdkLogger.error("GenFds", OPTION_MISSING, "WORKSPACE not defined",
ExtraData="Please use '-w' switch to pass it or set the WORKSPACE environment variable.")
elif not os.path.exists(Options.Workspace):
EdkLogger.error("GenFds", PARAMETER_INVALID, "WORKSPACE is invalid",
ExtraData="Please use '-w' switch to pass it or set the WORKSPACE environment variable.")
else:
Workspace = os.path.normcase(Options.Workspace)
GenFdsGlobalVariable.WorkSpaceDir = Workspace
if 'EDK_SOURCE' in os.environ.keys():
GenFdsGlobalVariable.EdkSourceDir = os.path.normcase(os.environ['EDK_SOURCE'])
if (Options.debug):
GenFdsGlobalVariable.VerboseLogger( "Using Workspace:" + Workspace)
os.chdir(GenFdsGlobalVariable.WorkSpaceDir)
# set multiple workspace
PackagesPath = os.getenv("PACKAGES_PATH")
mws.setWs(GenFdsGlobalVariable.WorkSpaceDir, PackagesPath)
if (Options.filename):
FdfFilename = Options.filename
FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename)
if FdfFilename[0:2] == '..':
FdfFilename = os.path.realpath(FdfFilename)
if not os.path.isabs (FdfFilename):
FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
if not os.path.exists(FdfFilename):
EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=FdfFilename)
GenFdsGlobalVariable.FdfFile = FdfFilename
GenFdsGlobalVariable.FdfFileTimeStamp = os.path.getmtime(FdfFilename)
else:
EdkLogger.error("GenFds", OPTION_MISSING, "Missing FDF filename")
if (Options.BuildTarget):
GenFdsGlobalVariable.TargetName = Options.BuildTarget
else:
EdkLogger.error("GenFds", OPTION_MISSING, "Missing build target")
if (Options.ToolChain):
GenFdsGlobalVariable.ToolChainTag = Options.ToolChain
else:
EdkLogger.error("GenFds", OPTION_MISSING, "Missing tool chain tag")
if (Options.activePlatform):
ActivePlatform = Options.activePlatform
ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform)
if ActivePlatform[0:2] == '..':
ActivePlatform = os.path.realpath(ActivePlatform)
if not os.path.isabs (ActivePlatform):
ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
if not os.path.exists(ActivePlatform) :
EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist!")
if os.path.normcase (ActivePlatform).find(Workspace) == 0:
ActivePlatform = mws.relpath(ActivePlatform, Workspace)
if len(ActivePlatform) > 0 :
if ActivePlatform[0] == '\\' or ActivePlatform[0] == '/':
ActivePlatform = ActivePlatform[1:]
else:
EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist!")
else:
EdkLogger.error("GenFds", OPTION_MISSING, "Missing active platform")
GenFdsGlobalVariable.ActivePlatform = PathClass(NormPath(ActivePlatform), Workspace)
if (Options.ConfDirectory):
# Get alternate Conf location, if it is absolute, then just use the absolute directory name
ConfDirectoryPath = os.path.normpath(Options.ConfDirectory)
if ConfDirectoryPath.startswith('"'):
#.........这里部分代码省略.........