| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 Google Inc. All rights reserved. | 2 # Copyright (c) 2013 Google Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 def to_str_name(self): | 398 def to_str_name(self): |
| 399 return self.name | 399 return self.name |
| 400 | 400 |
| 401 | 401 |
| 402 def generate_param_name(param_type): | 402 def generate_param_name(param_type): |
| 403 base_name = re.match("(const |PassRefPtr<)?(\w*)", param_type).group(2) | 403 base_name = re.match("(const |PassRefPtr<)?(\w*)", param_type).group(2) |
| 404 return "param" + base_name | 404 return "param" + base_name |
| 405 | 405 |
| 406 | 406 |
| 407 def agent_class_name(agent): | 407 def agent_class_name(agent): |
| 408 custom_agent_names = ["Inspector", "PageDebugger", "PageRuntime", "WorkerRun
time"] | 408 custom_agent_names = ["PageDebugger", "PageRuntime", "WorkerRuntime"] |
| 409 if agent in custom_agent_names: | 409 if agent in custom_agent_names: |
| 410 return "%sAgent" % agent | 410 return "%sAgent" % agent |
| 411 return "Inspector%sAgent" % agent | 411 return "Inspector%sAgent" % agent |
| 412 | 412 |
| 413 | 413 |
| 414 def agent_getter_signature(agent): | 414 def agent_getter_signature(agent): |
| 415 agent_class = agent_class_name(agent) | 415 agent_class = agent_class_name(agent) |
| 416 return agent_class, agent_class[0].lower() + agent_class[1:] | 416 return agent_class, agent_class[0].lower() + agent_class[1:] |
| 417 | 417 |
| 418 | 418 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 if not output_dirpath: | 513 if not output_dirpath: |
| 514 raise Exception("Output directory must be specified") | 514 raise Exception("Output directory must be specified") |
| 515 except Exception: | 515 except Exception: |
| 516 # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html | 516 # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html |
| 517 exc = sys.exc_info()[1] | 517 exc = sys.exc_info()[1] |
| 518 sys.stderr.write("Failed to parse command-line arguments: %s\n\n" % exc) | 518 sys.stderr.write("Failed to parse command-line arguments: %s\n\n" % exc) |
| 519 sys.stderr.write("Usage: <script> --output_dir <output_dir> InspectorInstrum
entation.idl\n") | 519 sys.stderr.write("Usage: <script> --output_dir <output_dir> InspectorInstrum
entation.idl\n") |
| 520 exit(1) | 520 exit(1) |
| 521 | 521 |
| 522 generate(input_path, output_dirpath) | 522 generate(input_path, output_dirpath) |
| OLD | NEW |