| 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 client_private_key = f.read() | 593 client_private_key = f.read() |
| 594 logging.info('Using OAuth login: %s' % client_email) | 594 logging.info('Using OAuth login: %s' % client_email) |
| 595 self.rpc_server = OAuthRpcServer(bot_url, | 595 self.rpc_server = OAuthRpcServer(bot_url, |
| 596 client_email, | 596 client_email, |
| 597 client_private_key, | 597 client_private_key, |
| 598 private_key_password=private_key_password, | 598 private_key_password=private_key_password, |
| 599 extra_headers=extra_headers or {}) | 599 extra_headers=extra_headers or {}) |
| 600 self._xsrf_token = None | 600 self._xsrf_token = None |
| 601 self._xsrf_token_time = None | 601 self._xsrf_token_time = None |
| 602 | 602 |
| 603 self._maxtries = 40 or maxtries | 603 self._maxtries = maxtries or 40 |
| 604 | 604 |
| 605 | 605 |
| 606 class CachingRietveld(Rietveld): | 606 class CachingRietveld(Rietveld): |
| 607 """Caches the common queries. | 607 """Caches the common queries. |
| 608 | 608 |
| 609 Not to be used in long-standing processes, like the commit queue. | 609 Not to be used in long-standing processes, like the commit queue. |
| 610 """ | 610 """ |
| 611 def __init__(self, *args, **kwargs): | 611 def __init__(self, *args, **kwargs): |
| 612 super(CachingRietveld, self).__init__(*args, **kwargs) | 612 super(CachingRietveld, self).__init__(*args, **kwargs) |
| 613 self._cache = {} | 613 self._cache = {} |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 self, issue, patchset, reason, clobber, revision, builders_and_tests, | 729 self, issue, patchset, reason, clobber, revision, builders_and_tests, |
| 730 master=None, category='cq'): | 730 master=None, category='cq'): |
| 731 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 731 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
| 732 (builders_and_tests, issue)) | 732 (builders_and_tests, issue)) |
| 733 | 733 |
| 734 def trigger_distributed_try_jobs( # pylint:disable=R0201 | 734 def trigger_distributed_try_jobs( # pylint:disable=R0201 |
| 735 self, issue, patchset, reason, clobber, revision, masters, | 735 self, issue, patchset, reason, clobber, revision, masters, |
| 736 category='cq'): | 736 category='cq'): |
| 737 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 737 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
| 738 (masters, issue)) | 738 (masters, issue)) |
| OLD | NEW |