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

Method dump

client/util/jsonclient.py:24–38  ·  view source on GitHub ↗

:param data: :param file_path: :return:

(data, file_path)

Source from the content-addressed store, hash-verified

22class JsonClient(object):
23 @staticmethod
24 def dump(data, file_path):
25 """
26
27 :param data:
28 :param file_path:
29 :return:
30 """
31 if sys.version_info.major == 2:
32 # python2兼容
33 with open(file_path, "w") as fp:
34 json.dump(data, fp, indent=2, ensure_ascii=False)
35 else:
36 # python3兼容
37 with open(file_path, "wb") as fp:
38 fp.write(str.encode(json.dumps(data, indent=2, ensure_ascii=False)))
39
40 @staticmethod
41 def load(file_path):

Callers 15

runMethod · 0.80
runMethod · 0.80
__format_rulesMethod · 0.80
scanMethod · 0.80
configMethod · 0.80
_set_stylelint_ruleMethod · 0.80
configMethod · 0.80
_set_eslint_configMethod · 0.80
_set_tsconfig_fileMethod · 0.80
configMethod · 0.80
checkMethod · 0.80

Calls 1

writeMethod · 0.45

Tested by 1

runMethod · 0.64