def get_list_file(self, projname, callback=None):
global list_module_files
global lmf_update_ongoing
lmf_update_ongoing = True
lmf = []
for folder in sublime.active_window().folders():
for root, dirs, files in os.walk(folder):
for fn in files:
if fn.lower().endswith(('.vhd','.vho','.vhdl')):
ffn = os.path.join(root,fn)
f = open(ffn)
if os.stat(ffn).st_size:
s = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
if s.find(b'entity') != -1:
lmf.append(ffn)
elif s.find(b'component') != -1:
lmf.append(ffn)
sublime.status_message('List of module files updated')
list_module_files[projname] = lmf[:]
lmf_update_ongoing = False
if callback:
callback()
评论列表
文章目录