OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 Google Inc. All rights reserved. | 2 # Copyright (c) 2012 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 # Basic regex for invalid JsDoc types: an object type name ([A-Z][A-Za-z0-9.]+[A
-Za-z0-9]) not preceded by '!', '?', ':' (this, new), or '.' (object property). | 90 # Basic regex for invalid JsDoc types: an object type name ([A-Z][A-Za-z0-9.]+[A
-Za-z0-9]) not preceded by '!', '?', ':' (this, new), or '.' (object property). |
91 invalid_type_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or + r')\s*\{.
*(?<![!?:.A-Za-z0-9])([A-Z][A-Za-z0-9.]+[A-Za-z0-9])[^/]*\}') | 91 invalid_type_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or + r')\s*\{.
*(?<![!?:.A-Za-z0-9])([A-Z][A-Za-z0-9.]+[A-Za-z0-9])[^/]*\}') |
92 invalid_type_designator_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or
+ r')\s*.*(?<![{: ])([?!])=?\}') | 92 invalid_type_designator_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or
+ r')\s*.*(?<![{: ])([?!])=?\}') |
93 invalid_non_object_type_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or
+ r')\s*\{.*(![a-z]+)[^/]*\}') | 93 invalid_non_object_type_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or
+ r')\s*\{.*(![a-z]+)[^/]*\}') |
94 error_warning_regex = re.compile(r'WARNING|ERROR') | 94 error_warning_regex = re.compile(r'WARNING|ERROR') |
95 loaded_css_regex = re.compile(r'(?:registerRequiredCSS|WebInspector\.View\.creat
eStyleElement)\s*\(\s*"(.+)"\s*\)') | 95 loaded_css_regex = re.compile(r'(?:registerRequiredCSS|WebInspector\.View\.creat
eStyleElement)\s*\(\s*"(.+)"\s*\)') |
96 | 96 |
97 java_build_regex = re.compile(r'^\w+ version "(\d+)\.(\d+)') | 97 java_build_regex = re.compile(r'^\w+ version "(\d+)\.(\d+)') |
98 errors_found = False | 98 errors_found = False |
99 | 99 |
100 generate_protocol_externs.generate_protocol_externs(protocol_externs_file, path.
join(devtools_path, 'protocol.json')) | 100 generate_protocol_externs.generate_protocol_externs(protocol_externs_file, path.
join(inspector_path, 'browser_protocol.js'), path.join(v8_inspector_path, 'v8_pr
otocol.js')) |
101 | 101 |
102 | 102 |
103 # Based on http://stackoverflow.com/questions/377017/test-if-executable-exists-i
n-python. | 103 # Based on http://stackoverflow.com/questions/377017/test-if-executable-exists-i
n-python. |
104 def which(program): | 104 def which(program): |
105 def is_exe(fpath): | 105 def is_exe(fpath): |
106 return path.isfile(fpath) and os.access(fpath, os.X_OK) | 106 return path.isfile(fpath) and os.access(fpath, os.X_OK) |
107 | 107 |
108 fpath, fname = path.split(program) | 108 fpath, fname = path.split(program) |
109 if fpath: | 109 if fpath: |
110 if is_exe(program): | 110 if is_exe(program): |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 print 'Validate InjectedScriptSource.js output:%s' % os.linesep, (validateInject
edScriptOut if validateInjectedScriptOut else '<empty>') | 516 print 'Validate InjectedScriptSource.js output:%s' % os.linesep, (validateInject
edScriptOut if validateInjectedScriptOut else '<empty>') |
517 errors_found |= hasErrors(validateInjectedScriptOut) | 517 errors_found |= hasErrors(validateInjectedScriptOut) |
518 | 518 |
519 if errors_found: | 519 if errors_found: |
520 print 'ERRORS DETECTED' | 520 print 'ERRORS DETECTED' |
521 | 521 |
522 os.remove(injectedScriptSourceTmpFile) | 522 os.remove(injectedScriptSourceTmpFile) |
523 os.remove(compiler_args_file.name) | 523 os.remove(compiler_args_file.name) |
524 os.remove(protocol_externs_file) | 524 os.remove(protocol_externs_file) |
525 shutil.rmtree(modules_dir, True) | 525 shutil.rmtree(modules_dir, True) |
OLD | NEW |