OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 from skypy.skyserver import SkyServer | 6 from skypy.skyserver import SkyServer |
7 import argparse | 7 import argparse |
8 import json | 8 import json |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 29 matching lines...) Expand all Loading... |
40 re.compile(r'^$'), | 40 re.compile(r'^$'), |
41 re.compile(r'^Analyzing \['), | 41 re.compile(r'^Analyzing \['), |
42 re.compile(r'^No issues found'), | 42 re.compile(r'^No issues found'), |
43 re.compile(r'^[0-9]+ errors? and [0-9]+ warnings? found.'), | 43 re.compile(r'^[0-9]+ errors? and [0-9]+ warnings? found.'), |
44 re.compile(r'^([0-9]+|No) (error|warning|issue)s? found.'), | 44 re.compile(r'^([0-9]+|No) (error|warning|issue)s? found.'), |
45 | 45 |
46 # TODO: Remove once sdk-extensions are in place | 46 # TODO: Remove once sdk-extensions are in place |
47 re.compile(r'^\[error\] Native functions can only be declared in'), | 47 re.compile(r'^\[error\] Native functions can only be declared in'), |
48 # TODO: Remove this once dev SDK includes Uri.directory constructor. | 48 # TODO: Remove this once dev SDK includes Uri.directory constructor. |
49 re.compile(r'.*The class \'Uri\' does not have a constructor \'directory\''), | 49 re.compile(r'.*The class \'Uri\' does not have a constructor \'directory\''), |
| 50 # TODO: Remove this once Sky no longer generates this warning. |
| 51 # dartbug.com/22836 |
| 52 re.compile(r'.*cannot both be unnamed'), |
50 ] | 53 ] |
51 | 54 |
52 # This 'strict dictionary' approach is useful for catching typos. | 55 # This 'strict dictionary' approach is useful for catching typos. |
53 class Pids(object): | 56 class Pids(object): |
54 def __init__(self, known_keys, contents=None): | 57 def __init__(self, known_keys, contents=None): |
55 self._known_keys = known_keys | 58 self._known_keys = known_keys |
56 self._dict = contents if contents is not None else {} | 59 self._dict = contents if contents is not None else {} |
57 | 60 |
58 def __len__(self): | 61 def __len__(self): |
59 return len(self._dict) | 62 return len(self._dict) |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 args = parser.parse_args() | 334 args = parser.parse_args() |
332 pids = Pids.read_from(PID_FILE_PATH, PID_FILE_KEYS) | 335 pids = Pids.read_from(PID_FILE_PATH, PID_FILE_KEYS) |
333 exit_code = args.func(args, pids) | 336 exit_code = args.func(args, pids) |
334 # We could do this with an at-exit handler instead? | 337 # We could do this with an at-exit handler instead? |
335 pids.write_to(PID_FILE_PATH) | 338 pids.write_to(PID_FILE_PATH) |
336 sys.exit(exit_code) | 339 sys.exit(exit_code) |
337 | 340 |
338 | 341 |
339 if __name__ == '__main__': | 342 if __name__ == '__main__': |
340 SkyShellRunner().main() | 343 SkyShellRunner().main() |
OLD | NEW |