資源簡介
自己從python打包的exe文件,把exe文件放到MDK工程文件夾下,雙擊即可生成文件列表,然后在source insight中打開導入文件列表即可,非常方便,不會有多余的文件添加到工程中,附帶python源碼也一起上傳了

代碼片段和文件信息
‘‘‘
This?tool?will?generate?source?insight?4?project?file?list
from?build?output?file?(*.dep),then?we?can?import?the
file?list?in?the?source?insight?4?project.
‘‘‘
import?os
import?sys
import?xml.etree.ElementTree?as?ET
from?datetime?import?datetime
import?re
#?1、Find?.dep?file
projectfilename?=?‘‘
sourcefile?=?‘‘
outputfile?=?‘‘
for?entry?in?os.scandir():
????if?entry.is_file():
????????if?entry.name.endswith(‘.eww‘):
????????????projectfilename?=?entry.name
????????????#?find?current?target
????????????wsdtfile?=?os.path.join(os.getcwd()?‘settings‘)
????????????wsdtfile?=?os.path.join(wsdtfile?entry.name.replace(‘.eww‘?‘.wsdt‘))
????????????if?os.path.exists(wsdtfile):
????????????????tree?=?ET.ElementTree(file=wsdtfile)
????????????????ConfigDictionary?=?tree.find(‘ConfigDictionary‘)
????????????????CurrentConfigs?=?ConfigDictionary.find(‘CurrentConfigs‘)
????????????????TargetName?=?CurrentConfigs.find(‘Project‘).text.split(‘/‘)[1]
????????????????depfilename?=?CurrentConfigs.find(‘Project‘).text.split(‘/‘)[0]?+?‘.dep‘
????????????????if?os.path.exists(depfilename):
????????????????????sourcefile?=?depfilename
????????????????????outputfile?=?os.path.splitext(projectfilename)[0]
????????????????????break
????????????print(‘Please?build?the?project?once1‘)
????????????input()
????????????sys.exit(0)
????????elif?entry.name.endswith(‘.uvproj‘)?or?entry.name.endswith(‘.uvprojx‘):
????????????projectfilename?=?entry.name
????????????if?entry.name.endswith(‘.uvproj‘):
????????????????uvoptfile?=?entry.name.replace(‘.uvproj‘?‘.uvopt‘)
????????????elif?entry.name.endswith(‘.uvprojx‘):
????????????????uvoptfile?=?entry.name.replace(‘.uvprojx‘?‘.uvoptx‘)
????????????tree?=?ET.ElementTree(file=uvoptfile)
????????????#?find?current?target
????????????for?tag?in?tree.findall(‘Target‘):
????????????????TargetOption?=?tag.find(‘TargetOption‘)
????????????????OPTFL?=?TargetOption.find(‘OPTFL‘)
????????????????IsCurrentTarget?=?int(OPTFL.find(‘IsCurrentTarget‘).text)
????????????????if?IsCurrentTarget:
????????????????????TargetName?=?tag.find(‘TargetName‘).text
????????????????????break
????????????#?find?dep?file?of?current?target
????????????Extensions?=?tree.find(‘Extensions‘)
????????????print(Extensions.findtext(‘nMigrate‘))
????????????#if?None?==?Extensions.findtext(‘nMigrate‘):
????????????if?False:
????????????????#?ide?is?keil4
????????????????depfilename?=?os.path.splitext(projectfilename)[0]?+?‘_‘?+?TargetName?+?‘.dep‘
????????????????print(“mark2“+depfilename)
????????????????print(“projectfilename?“+projectfilename)
????????????????if?os.path.exists(depfilename):
????????????????????sourcefile?=?depfilename
????????????????????outputfile?=?os.path.splitext(projectfilename)[0]
????????????????else:
????????????????????#print(os.path.exists(depfilename))
????????????????????print(os.path)
????????????????????print(projectfilename)
????????????else:
???
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????6427??2019-02-13?23:49??source_insight4_mdk_tool.py
?????文件?????5264479??2019-02-13?23:49??source_insight4_mdk_tool.exe
評論
共有 條評論