Chromium Code Reviews| 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 # appengine replies with 302 when authentication fails (sigh) | |
|
Ryan Tseng
2014/04/17 17:10:40
nit: s/appengine/Appengine/g
Also add period.
pgervais
2014/04/17 17:28:00
Done.
| |
| 34 oa2client.REFRESH_STATUS_CODES = [302, 401] | |
|
Ryan Tseng
2014/04/17 17:10:40
Use oa2client.REFRESH_STATUS_CODES.append(302) ins
pgervais
2014/04/17 17:28:00
Done.
M-A Ruel
2014/04/17 19:12:47
You forgot to upload a new version.
| |
| 33 upload.LOGGER.setLevel(logging.WARNING) # pylint: disable=E1103 | 35 upload.LOGGER.setLevel(logging.WARNING) # pylint: disable=E1103 |
| 34 | 36 |
| 35 | 37 |
| 36 class Rietveld(object): | 38 class Rietveld(object): |
| 37 """Accesses rietveld.""" | 39 """Accesses rietveld.""" |
| 38 def __init__(self, url, email, password, extra_headers=None): | 40 def __init__(self, url, email, password, extra_headers=None): |
| 39 self.url = url.rstrip('/') | 41 self.url = url.rstrip('/') |
| 40 # Email and password are accessed by commit queue, keep them. | 42 # Email and password are accessed by commit queue, keep them. |
| 41 self.email = email | 43 self.email = email |
| 42 self.password = password | 44 self.password = password |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 def trigger_try_jobs( # pylint:disable=R0201 | 704 def trigger_try_jobs( # pylint:disable=R0201 |
| 703 self, issue, patchset, reason, clobber, revision, builders_and_tests, | 705 self, issue, patchset, reason, clobber, revision, builders_and_tests, |
| 704 master=None): | 706 master=None): |
| 705 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 707 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
| 706 (builders_and_tests, issue)) | 708 (builders_and_tests, issue)) |
| 707 | 709 |
| 708 def trigger_distributed_try_jobs( # pylint:disable=R0201 | 710 def trigger_distributed_try_jobs( # pylint:disable=R0201 |
| 709 self, issue, patchset, reason, clobber, revision, masters): | 711 self, issue, patchset, reason, clobber, revision, masters): |
| 710 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 712 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
| 711 (masters, issue)) | 713 (masters, issue)) |
| OLD | NEW |