OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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.6.1' | 9 __version__ = '1.6.1' |
10 | 10 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 self.host_url = 'http://codereview.chromium.org' | 236 self.host_url = 'http://codereview.chromium.org' |
237 if self.rietveld: | 237 if self.rietveld: |
238 self.host_url = rietveld.url | 238 self.host_url = rietveld.url |
239 | 239 |
240 # We expose various modules and functions as attributes of the input_api | 240 # We expose various modules and functions as attributes of the input_api |
241 # so that presubmit scripts don't have to import them. | 241 # so that presubmit scripts don't have to import them. |
242 self.basename = os.path.basename | 242 self.basename = os.path.basename |
243 self.cPickle = cPickle | 243 self.cPickle = cPickle |
244 self.cStringIO = cStringIO | 244 self.cStringIO = cStringIO |
245 self.json = json | 245 self.json = json |
| 246 self.logging = logging.getLogger('PRESUBMIT') |
246 self.os_listdir = os.listdir | 247 self.os_listdir = os.listdir |
247 self.os_walk = os.walk | 248 self.os_walk = os.walk |
248 self.os_path = os.path | 249 self.os_path = os.path |
249 self.pickle = pickle | 250 self.pickle = pickle |
250 self.marshal = marshal | 251 self.marshal = marshal |
251 self.re = re | 252 self.re = re |
252 self.subprocess = subprocess | 253 self.subprocess = subprocess |
253 self.tempfile = tempfile | 254 self.tempfile = tempfile |
254 self.time = time | 255 self.time = time |
255 self.traceback = traceback | 256 self.traceback = traceback |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 except PresubmitFailure, e: | 1237 except PresubmitFailure, e: |
1237 print >> sys.stderr, e | 1238 print >> sys.stderr, e |
1238 print >> sys.stderr, 'Maybe your depot_tools is out of date?' | 1239 print >> sys.stderr, 'Maybe your depot_tools is out of date?' |
1239 print >> sys.stderr, 'If all fails, contact maruel@' | 1240 print >> sys.stderr, 'If all fails, contact maruel@' |
1240 return 2 | 1241 return 2 |
1241 | 1242 |
1242 | 1243 |
1243 if __name__ == '__main__': | 1244 if __name__ == '__main__': |
1244 fix_encoding.fix_encoding() | 1245 fix_encoding.fix_encoding() |
1245 sys.exit(Main(None)) | 1246 sys.exit(Main(None)) |
OLD | NEW |