MCPcopy Index your code
hub / github.com/nodejs/node / ReadInputJSON

Method ReadInputJSON

deps/v8/tools/mb/mb.py:1139–1156  ·  view source on GitHub ↗
(self, required_keys)

Source from the content-addressed store, hash-verified

1137 return 0
1138
1139 def ReadInputJSON(self, required_keys):
1140 path = self.args.input_path[0]
1141 output_path = self.args.output_path[0]
1142 if not self.Exists(path):
1143 self.WriteFailureAndRaise('"%s" does not exist' % path, output_path)
1144
1145 try:
1146 inp = json.loads(self.ReadFile(path))
1147 except Exception as e:
1148 self.WriteFailureAndRaise('Failed to read JSON input from "%s": %s' %
1149 (path, e), output_path)
1150
1151 for k in required_keys:
1152 if not k in inp:
1153 self.WriteFailureAndRaise('input file is missing a "%s" key' % k,
1154 output_path)
1155
1156 return inp
1157
1158 def WriteFailureAndRaise(self, msg, output_path):
1159 if output_path:

Callers 1

RunGNAnalyzeMethod · 0.95

Calls 3

ExistsMethod · 0.95
WriteFailureAndRaiseMethod · 0.95
ReadFileMethod · 0.95

Tested by

no test coverage detected