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

Unified Diff: my_activity.py

Issue 46413002: Switch my_activity.py to use gerrit_util for gerrit REST connections (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 2 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 | « gerrit_util.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: my_activity.py
diff --git a/my_activity.py b/my_activity.py
index 3d73c8b1c3908853d714b14754f412203eb43ddd..ca5738d6f9759e76cd677995c4eaa24cfd84237b 100755
--- a/my_activity.py
+++ b/my_activity.py
@@ -35,6 +35,7 @@ import sys
import urllib
import urllib2
+import gerrit_util
import rietveld
from third_party import upload
@@ -119,12 +120,10 @@ gerrit_instances = [
'url': 'chromium-review.googlesource.com',
'shorturl': 'crosreview.com',
},
- # TODO(deymo): chrome-internal-review requires login credentials. Enable once
- # login support is added to this client. See crbug.com/281695.
- #{
- # 'url': 'chrome-internal-review.googlesource.com',
- # 'shorturl': 'crosreview.com/i',
- #},
+ {
+ 'url': 'chrome-internal-review.googlesource.com',
+ 'shorturl': 'crosreview.com/i',
+ },
{
'host': 'gerrit.chromium.org',
'port': 29418,
@@ -411,14 +410,13 @@ class MyActivity(object):
('q', ' '.join(filters)),
('o', 'MESSAGES'),
('o', 'LABELS')])
- rest_url = 'https://%s/changes/?%s' % (instance['url'], args)
+ conn = gerrit_util.CreateHttpConn(instance['url'], 'changes/?%s' % args)
- req = urllib2.Request(rest_url, headers={'Accept': 'text/plain'})
try:
- response = urllib2.urlopen(req)
+ response = gerrit_util.ReadHttpResponse(conn, ignore_404=False)
stdout = response.read()
- except urllib2.HTTPError, e:
- print 'ERROR: Looking up %r: %s' % (rest_url, e)
+ except gerrit_util.GerritError, e:
+ print 'ERROR: Looking up %r: %s' % (instance['url'], e)
return []
# Check that the returned JSON starts with the right marker.
« no previous file with comments | « gerrit_util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698