def match_selection(self, sel, tooltip_files, scope):
""" this method take care to the results, links and the keys which be implemented in the tooltip """
results = []
count = 0
dynamic_doc_arr = self.search_for_dynamic_doc(sel, scope)
if dynamic_doc_arr:
results += dynamic_doc_arr
else:
self.logger_msg += 'There is no documentation in dynamic doc\n'
for file in tooltip_files:
# search the parameter in json file
json_result = self.search_in_json(sel, file['file_name'])
items = []
if isinstance(json_result, dict):
items.append(json_result)
elif isinstance(json_result, list):
items += json_result
for item in items:
result = {}
if item:
result['json_result'] = item
result['file_name'] = file['file_name']
# get the correct link for the result
if 'link' not in item and \
'link' in file:
result['link'] = file['link']
results.append(result)
# get the keys from the result
keys = list(item.keys())
# add key to keyorder and count the change
count += self.update_keyorder_list(keys)
# if there is one change, save it in settings.
if count != 0:
self.save_keyorder_list()
return results
评论列表
文章目录