MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / load

Method load

client/util/jsonclient.py:41–59  ·  view source on GitHub ↗

:param file_path: :return:

(file_path)

Source from the content-addressed store, hash-verified

39
40 @staticmethod
41 def load(file_path):
42 """
43
44 :param file_path:
45 :return:
46 """
47 if sys.version_info.major == 2:
48 # python2兼容
49 with open(file_path, 'r') as rf:
50 result_json = json.load(rf)
51 for key, value in result_json.items():
52 if isinstance(value, unicode):
53 result_json[key] = value.encode('utf-8')
54 else:
55 # python3兼容
56 with open(file_path, 'r', encoding="utf-8") as rf:
57 result_json = json.load(rf)
58
59 return result_json

Callers 15

runMethod · 0.45
get_resultMethod · 0.45
analyzeMethod · 0.45
configMethod · 0.45
configMethod · 0.45
_set_eslint_configMethod · 0.45
configMethod · 0.45
analyzeMethod · 0.45
analyzeMethod · 0.45
get_issueMethod · 0.45
analyzeMethod · 0.45
scanMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected