OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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 """Enables directory-specific presubmit checks to run at upload and/or commit. | 6 """Enables directory-specific presubmit checks to run at upload and/or commit. |
7 """ | 7 """ |
8 | 8 |
9 __version__ = '1.3.4' | 9 __version__ = '1.3.4' |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 import subprocess # Exposed through the API. | 27 import subprocess # Exposed through the API. |
28 import sys # Parts exposed through API. | 28 import sys # Parts exposed through API. |
29 import tempfile # Exposed through the API. | 29 import tempfile # Exposed through the API. |
30 import time | 30 import time |
31 import traceback # Exposed through the API. | 31 import traceback # Exposed through the API. |
32 import types | 32 import types |
33 import unittest # Exposed through the API. | 33 import unittest # Exposed through the API. |
34 import urllib2 # Exposed through the API. | 34 import urllib2 # Exposed through the API. |
35 import warnings | 35 import warnings |
36 | 36 |
37 # json may not be available. | |
38 try: | 37 try: |
39 import simplejson as json | 38 import simplejson as json |
40 except ImportError: | 39 except ImportError: |
41 try: | 40 try: |
42 import json | 41 import json |
43 except ImportError: | 42 except ImportError: |
44 json = None | 43 # Import the one included in depot_tools. |
| 44 import third_party.simplejson as json |
45 | 45 |
46 # Local imports. | 46 # Local imports. |
47 import gcl | 47 import gcl |
48 import gclient_utils | 48 import gclient_utils |
49 import presubmit_canned_checks | 49 import presubmit_canned_checks |
50 import scm | 50 import scm |
51 | 51 |
52 | 52 |
53 # Ask for feedback only once in program lifetime. | 53 # Ask for feedback only once in program lifetime. |
54 _ASKED_FOR_FEEDBACK = False | 54 _ASKED_FOR_FEEDBACK = False |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 options.commit, | 1059 options.commit, |
1060 options.verbose, | 1060 options.verbose, |
1061 sys.stdout, | 1061 sys.stdout, |
1062 sys.stdin, | 1062 sys.stdin, |
1063 options.default_presubmit, | 1063 options.default_presubmit, |
1064 options.may_prompt) | 1064 options.may_prompt) |
1065 | 1065 |
1066 | 1066 |
1067 if __name__ == '__main__': | 1067 if __name__ == '__main__': |
1068 sys.exit(Main(sys.argv)) | 1068 sys.exit(Main(sys.argv)) |
OLD | NEW |