OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Defines class Rietveld to easily access a rietveld instance. | 5 """Defines class Rietveld to easily access a rietveld instance. |
6 | 6 |
7 Security implications: | 7 Security implications: |
8 | 8 |
9 The following hypothesis are made: | 9 The following hypothesis are made: |
10 - Rietveld enforces: | 10 - Rietveld enforces: |
(...skipping 12 matching lines...) Expand all Loading... |
23 import urllib | 23 import urllib |
24 import urllib2 | 24 import urllib2 |
25 import urlparse | 25 import urlparse |
26 | 26 |
27 import patch | 27 import patch |
28 | 28 |
29 from third_party import upload | 29 from third_party import upload |
30 import third_party.oauth2client.client as oa2client | 30 import third_party.oauth2client.client as oa2client |
31 from third_party import httplib2 | 31 from third_party import httplib2 |
32 | 32 |
33 # Hack out upload logging.info() | 33 upload.LOGGER.setLevel(logging.WARNING) # pylint: disable=E1103 |
34 upload.logging = logging.getLogger('upload') | |
35 # Mac pylint choke on this line. | |
36 upload.logging.setLevel(logging.WARNING) # pylint: disable=E1103 | |
37 | 34 |
38 | 35 |
39 class Rietveld(object): | 36 class Rietveld(object): |
40 """Accesses rietveld.""" | 37 """Accesses rietveld.""" |
41 def __init__(self, url, email, password, extra_headers=None): | 38 def __init__(self, url, email, password, extra_headers=None): |
42 self.url = url.rstrip('/') | 39 self.url = url.rstrip('/') |
43 # Email and password are accessed by commit queue, keep them. | 40 # Email and password are accessed by commit queue, keep them. |
44 self.email = email | 41 self.email = email |
45 self.password = password | 42 self.password = password |
46 # TODO(maruel): It's not awesome but maybe necessary to retrieve the value. | 43 # TODO(maruel): It's not awesome but maybe necessary to retrieve the value. |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 def trigger_try_jobs( # pylint:disable=R0201 | 693 def trigger_try_jobs( # pylint:disable=R0201 |
697 self, issue, patchset, reason, clobber, revision, builders_and_tests, | 694 self, issue, patchset, reason, clobber, revision, builders_and_tests, |
698 master=None): | 695 master=None): |
699 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 696 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
700 (builders_and_tests, issue)) | 697 (builders_and_tests, issue)) |
701 | 698 |
702 def trigger_distributed_try_jobs( # pylint:disable=R0201 | 699 def trigger_distributed_try_jobs( # pylint:disable=R0201 |
703 self, issue, patchset, reason, clobber, revision, masters): | 700 self, issue, patchset, reason, clobber, revision, masters): |
704 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 701 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
705 (masters, issue)) | 702 (masters, issue)) |
OLD | NEW |