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

Unified Diff: rietveld.py

Issue 6825008: First stab at using Rietveld wrapper object in both gcl.py and git-cl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: small fix Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « presubmit_support.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rietveld.py
diff --git a/rietveld.py b/rietveld.py
index 11f901865e17951c06205bcffb6989e04e710403..98422d64675abd7469534a2a61a394a701ce0d8a 100644
--- a/rietveld.py
+++ b/rietveld.py
@@ -42,15 +42,16 @@ class Rietveld(object):
"""Accesses rietveld."""
def __init__(self, url, email, password):
self.issue = None
- self.user = email
self.url = url
- self._get_creds = lambda: (email, password)
+ if email and password:
+ get_creds = lambda: (email, password)
+ self.rpc_server = upload.HttpRpcServer(
+ self.url,
+ get_creds)
+ else:
+ self.rpc_server = upload.GetRpcServer(url, email)
self._xsrf_token = None
self._xsrf_token_time = None
- self.rpc_server = upload.HttpRpcServer(
- self.url,
- self._get_creds,
- save_cookies=False)
def xsrf_token(self):
if (not self._xsrf_token_time or
@@ -175,7 +176,8 @@ class Rietveld(object):
(flag, value)])
def get(self, request_path, **kwargs):
- return self._send(request_path, payload=None, **kwargs)
+ kwargs.setdefault('payload', None)
+ return self._send(request_path, **kwargs)
def post(self, request_path, data, **kwargs):
ctype, body = upload.EncodeMultipartFormData(data, [])
@@ -203,3 +205,6 @@ class Rietveld(object):
raise
# If reaching this line, loop again. Uses a small backoff.
time.sleep(1+maxtries*2)
+
+ # DEPRECATED.
+ Send = get
« no previous file with comments | « presubmit_support.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698