MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / main

Function main

Scripts/InstructionCountParser.py:225–254  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223 return 0
224
225def main():
226 if sys.version_info[0] < 3:
227 logging.critical ("Python 3 or a more recent version is required.")
228
229 if (len(sys.argv) < 3):
230 logging.critical ("usage: %s <PerformanceTests.json> <output_folder>" % (sys.argv[0]))
231
232 json_path = sys.argv[1]
233 output_binary_path = sys.argv[2]
234
235 try:
236 with open(json_path) as json_file:
237 json_text = json_file.read()
238 except IOError:
239 logging.error("IOError!")
240 return 1
241
242 try:
243 json_data = json.loads(json_text)
244 if not isinstance(json_data, dict):
245 raise TypeError('JSON data must be a dict')
246
247 return parse_json_data(json_path, os.path.basename(json_path), json_data, output_binary_path)
248
249 except ValueError as ve:
250 logging.error(f'JSON error: {ve}')
251
252 return 1
253
254 return 0
255
256if __name__ == "__main__":
257# execute only if run as a script

Callers 1

Calls 1

parse_json_dataFunction · 0.85

Tested by

no test coverage detected