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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 ('message', message), | 250 ('message', message), |
251 ('message_only', 'True'), | 251 ('message_only', 'True'), |
252 ('add_as_reviewer', str(bool(add_as_reviewer))), | 252 ('add_as_reviewer', str(bool(add_as_reviewer))), |
253 ('send_mail', 'True'), | 253 ('send_mail', 'True'), |
254 ('no_redirect', 'True')]) | 254 ('no_redirect', 'True')]) |
255 | 255 |
256 def set_flag(self, issue, patchset, flag, value): | 256 def set_flag(self, issue, patchset, flag, value): |
257 return self.post('/%d/edit_flags' % issue, [ | 257 return self.post('/%d/edit_flags' % issue, [ |
258 ('last_patchset', str(patchset)), | 258 ('last_patchset', str(patchset)), |
259 ('xsrf_token', self.xsrf_token()), | 259 ('xsrf_token', self.xsrf_token()), |
260 (flag, value)]) | 260 (flag, str(value))]) |
261 | 261 |
262 def search( | 262 def search( |
263 self, | 263 self, |
264 owner=None, reviewer=None, | 264 owner=None, reviewer=None, |
265 base=None, | 265 base=None, |
266 closed=None, private=None, commit=None, | 266 closed=None, private=None, commit=None, |
267 created_before=None, created_after=None, | 267 created_before=None, created_after=None, |
268 modified_before=None, modified_after=None, | 268 modified_before=None, modified_after=None, |
269 per_request=None, keys_only=False, | 269 per_request=None, keys_only=False, |
270 with_messages=False): | 270 with_messages=False): |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 | 512 |
513 def set_flag(self, issue, patchset, flag, value): # pylint:disable=R0201 | 513 def set_flag(self, issue, patchset, flag, value): # pylint:disable=R0201 |
514 logging.info('ReadOnlyRietveld: setting flag "%s" to "%s" for issue %d' % | 514 logging.info('ReadOnlyRietveld: setting flag "%s" to "%s" for issue %d' % |
515 (flag, value, issue)) | 515 (flag, value, issue)) |
516 ReadOnlyRietveld._local_changes.setdefault(issue, {})[flag] = value | 516 ReadOnlyRietveld._local_changes.setdefault(issue, {})[flag] = value |
517 | 517 |
518 def trigger_try_jobs( # pylint:disable=R0201 | 518 def trigger_try_jobs( # pylint:disable=R0201 |
519 self, issue, patchset, reason, clobber, revision, builders_and_tests): | 519 self, issue, patchset, reason, clobber, revision, builders_and_tests): |
520 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 520 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
521 (builders_and_tests, issue)) | 521 (builders_and_tests, issue)) |
OLD | NEW |