コード例 #1
0
ファイル: blsprj.py プロジェクト: ReanBSS/SublimeBSS
	def update_bls(self):
		self.uses    = []
		self.dep     = []

		if self.bls.is_exists():
			data = self.bls.get_data()
			self.bls.update_md5(data)
			self.uses = utils.parse_bls(data, 'uses')
コード例 #2
0
ファイル: FindBLSFunc.py プロジェクト: ReanBSS/SublimeBSS
	def find_bls(self, cur_file_path, cur_file_text):
		"Вернет список всех bls файлов в проекте, которые экспортируют искомую функцию"
		path = PathResolver(cur_file_path).GetBlsDir()
		uses = utils.parse_bls(cur_file_text, 'uses')
		name = utils.file_name_by_fullname(cur_file_path)
		uses.append(name)
		
		bls_files = []
		for root, dirs, filenames in os.walk(path):
			for filename in fnmatch.filter(filenames, '*.bls'):
				name = utils.file_name_by_basename(filename)
				if name in uses:
					full_path = os.path.join(root, filename)
					exports = utils.parse_bls(open(full_path).read(), 'exports')
					if self.func in exports:
						bls_files.append(full_path)
		return bls_files