Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: rietveld.py

Issue 7058054: Add --rietveld_XXX arguments to presubmit_support to the commit queue can use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « presubmit_support.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 """Defines class Rietveld to easily access a rietveld instance. 4 """Defines class Rietveld to easily access a rietveld instance.
5 5
6 Security implications: 6 Security implications:
7 7
8 The following hypothesis are made: 8 The following hypothesis are made:
9 - Rietveld enforces: 9 - Rietveld enforces:
10 - Nobody else than issue owner can upload a patch set 10 - Nobody else than issue owner can upload a patch set
(...skipping 24 matching lines...) Expand all
35 # Hack out upload logging.info() 35 # Hack out upload logging.info()
36 upload.logging = logging.getLogger('upload') 36 upload.logging = logging.getLogger('upload')
37 # Mac pylint choke on this line. 37 # Mac pylint choke on this line.
38 upload.logging.setLevel(logging.WARNING) # pylint: disable=E1103 38 upload.logging.setLevel(logging.WARNING) # pylint: disable=E1103
39 39
40 40
41 class Rietveld(object): 41 class Rietveld(object):
42 """Accesses rietveld.""" 42 """Accesses rietveld."""
43 def __init__(self, url, email, password, extra_headers=None): 43 def __init__(self, url, email, password, extra_headers=None):
44 self.url = url 44 self.url = url
45 # TODO(maruel): It's not awesome but maybe necessary to retrieve the value.
46 # It happens when the presubmit check is ran out of process, the cookie
47 # needed to be recreated from the credentials. Instead, it should pass the
48 # email and the cookie.
49 self.email = email
50 self.password = password
45 if email and password: 51 if email and password:
46 get_creds = lambda: (email, password) 52 get_creds = lambda: (email, password)
47 self.rpc_server = upload.HttpRpcServer( 53 self.rpc_server = upload.HttpRpcServer(
48 self.url, 54 self.url,
49 get_creds, 55 get_creds,
50 extra_headers=extra_headers or {}) 56 extra_headers=extra_headers or {})
51 else: 57 else:
52 self.rpc_server = upload.GetRpcServer(url, email) 58 self.rpc_server = upload.GetRpcServer(url, email)
53 self._xsrf_token = None 59 self._xsrf_token = None
54 self._xsrf_token_time = None 60 self._xsrf_token_time = None
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 if retry >= (maxtries - 1): 211 if retry >= (maxtries - 1):
206 raise 212 raise
207 if not 'Name or service not known' in e.reason: 213 if not 'Name or service not known' in e.reason:
208 # Usually internal GAE flakiness. 214 # Usually internal GAE flakiness.
209 raise 215 raise
210 # If reaching this line, loop again. Uses a small backoff. 216 # If reaching this line, loop again. Uses a small backoff.
211 time.sleep(1+maxtries*2) 217 time.sleep(1+maxtries*2)
212 218
213 # DEPRECATED. 219 # DEPRECATED.
214 Send = get 220 Send = get
OLDNEW
« no previous file with comments | « presubmit_support.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698