使用PYTHON转换一下包含的文件格式,OCC默认使用的 <XXXX.hxx> qt不能识别,需要转换为 "xxxx.hxx"
有知道怎么设置识别的请告诉我 谢谢
以下是python代码,从occ文件夹获取文件到qt程序下的目录
#coding=utf-8
#get the file from occ
# copy the file and change its header include
import os
import os.path
import shutil
import re
def findStr(fml_s):
match = re.search('(^#include\s+)<(.*\.(hxx|lxx))>', fml_s)
if match:
ms = match.group()
fline = chStr(fml_s)
headername=match.group(2)
print('find' ,match.group(2))
print('find in line',fline)
return True, fml_s, headername
else:
return False, fml_s, ''
def chStr(fml_s):
fml_s = re.sub('<','"occ_math/',fml_s)
fml_s=re.sub('>','"',fml_s)
return fml_s
def getPack(fml_s): #get a package name from file name /occ defined it
match=re.match('[a-zA-Z0-9]+',fml_s)
#print(match.group())
return match.group()
def rmSuffix(fml_s):
match=re.match('(.+)\.+',fml_s)
print(match)
return match.group(1)
class findSons:
filename=''
occPath= ''
ffn=''
ct=0
def __init__(self,fml_sName,fml_soccPa