Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Map/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def dynamicMatch(callAPI,runCommand,runPath,projName,copyFile,version,virtualEnv
#当runPath不在runCommand中时,需要切换到运行文件所在的目录执行命令
#而文件操作的相对路径就是相对于命令执行的路径
if runPath!='' and runPath not in runCommand:
l=len(runPath.split('/'))
normalized_runPath = runPath.replace('\\', '/')
l=len(normalized_runPath.split('/'))
while l>0:
pklPrefix='../'+pklPrefix
jsonPrefix='../'+jsonPrefix
Expand Down
6 changes: 4 additions & 2 deletions Preprocess/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,8 @@ def addDictAll(projPath,projName,filePath,runFileLst,libName,runPath,runCommand)
#当runPath不在runCommand中时,需要切换到运行文件所在的目录执行命令
#而文件操作的相对路径就是相对于命令执行的路径
if runPath!='' and runPath not in runCommand:
l=len(runPath.split('/'))
normalized_runPath = runPath.replace('\\', '/')
l=len(normalized_runPath.split('/'))
while l>0:
pklPrefix='../'+pklPrefix
l-=1
Expand Down Expand Up @@ -780,7 +781,8 @@ def handleRunFile(file,runPath,runCommand):
#而文件操作的相对路径就是相对于命令执行的路径
pklPrefix=f"../../Copy/pkl"
if runPath!='' and runPath not in runCommand:
l=len(runPath.split('/'))
normalized_runPath = runPath.replace('\\', '/')
l=len(normalized_runPath.split('/'))
while l>0:
pklPrefix='../'+pklPrefix
l-=1
Expand Down
2 changes: 1 addition & 1 deletion Tool/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def get_parameter(p_string,separator=',',space=1):
# @return root The parsed AST root
def getAst(filePath,strFlag=0): #若strFlag=1,则表明传进来的是一个api,而不是一个路径
if strFlag==0:
with open(filePath,'r') as f:
with open(filePath,'r',encoding='UTF-8') as f:
s=f.read()
root=ast.parse(s,filename='<unknown>',mode='exec')
return root
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def backward(projPath,libName,currentVersion,currentEnv,targetVersion,targetEnv,
pathObj=Path('DF')
pathObj.getPath(projPath)
filePath=[it for it in pathObj.path if it.endswith('py')] #保留项目中的.py文件
projName=projPath.split('/')[-1]
projName=os.path.basename(projPath)

#先在起始版本中生成每个API的pkl
# pythonPath=f"{currentEnv}/bin/python"
Expand Down