def _deSubstPath(path):
"""desubstitude craft short path"""
if not OsDetection.isWin():
return path
drive, tail = os.path.splitdrive(path)
drive = drive.upper()
if CraftStandardDirs._SUBST == None:
tmp = subprocess.getoutput("subst").split("\n")
CraftStandardDirs._SUBST = {}
for s in tmp:
if s != "":
key, val = s.split("\\: => ")
CraftStandardDirs._SUBST[key] = val
if drive in CraftStandardDirs._SUBST:
deSubst = CraftStandardDirs._SUBST[drive] + tail
return deSubst
return path
评论列表
文章目录