OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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.5' | 9 __version__ = '1.3.5' |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
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 from warnings import warn | 35 from warnings import warn |
36 | 36 |
37 try: | 37 try: |
38 import simplejson as json | 38 import simplejson as json # pylint: disable=F0401 |
39 except ImportError: | 39 except ImportError: |
40 try: | 40 try: |
41 import json | 41 import json |
42 # Some versions of python2.5 have an incomplete json module. Check to make | 42 # Some versions of python2.5 have an incomplete json module. Check to make |
43 # sure loads exists. | 43 # sure loads exists. |
44 # Statement seems to have no effect | 44 # Statement seems to have no effect |
45 # pylint: disable=W0104 | 45 # pylint: disable=W0104 |
46 json.loads | 46 json.loads |
47 except (ImportError, AttributeError): | 47 except (ImportError, AttributeError): |
48 # Import the one included in depot_tools. | 48 # Import the one included in depot_tools. |
49 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) | 49 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) |
50 import simplejson as json | 50 import simplejson as json # pylint: disable=F0401 |
51 | 51 |
52 # Local imports. | 52 # Local imports. |
53 import gclient_utils | 53 import gclient_utils |
54 import owners | 54 import owners |
55 import presubmit_canned_checks | 55 import presubmit_canned_checks |
56 import scm | 56 import scm |
57 | 57 |
58 | 58 |
59 # Ask for feedback only once in program lifetime. | 59 # Ask for feedback only once in program lifetime. |
60 _ASKED_FOR_FEEDBACK = False | 60 _ASKED_FOR_FEEDBACK = False |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 options.commit, | 1174 options.commit, |
1175 options.verbose, | 1175 options.verbose, |
1176 sys.stdout, | 1176 sys.stdout, |
1177 sys.stdin, | 1177 sys.stdin, |
1178 options.default_presubmit, | 1178 options.default_presubmit, |
1179 options.may_prompt) | 1179 options.may_prompt) |
1180 | 1180 |
1181 | 1181 |
1182 if __name__ == '__main__': | 1182 if __name__ == '__main__': |
1183 sys.exit(Main(sys.argv)) | 1183 sys.exit(Main(sys.argv)) |
OLD | NEW |