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

Unified Diff: my_activity.py

Issue 1075723002: Extract authentication options handling into a separate function. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 5 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 | « git_cl.py ('k') | my_reviews.py » ('j') | 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 720d9255cd308c58fb0b6c9291aea28ef9189317..35ec4d87f370f75881e859cef7e37f08dd2d31ff 100755
--- a/my_activity.py
+++ b/my_activity.py
@@ -13,6 +13,9 @@ Example:
- my_activity.py -b 4/5/12 -e 6/7/12 for stats between 4/5/12 and 6/7/12.
"""
+# TODO(vadimsh): This script knows too much about ClientLogin and cookies. It
+# will stop to work on ~20 Apr 2015.
+
# These services typically only provide a created time and a last modified time
# for each item for general queries. This is not enough to determine if there
# was activity in a given time period. So, we first query for all things created
@@ -33,6 +36,7 @@ import sys
import urllib
import urllib2
+import auth
import gerrit_util
import rietveld
from third_party import upload
@@ -267,7 +271,8 @@ class MyActivity(object):
email = None if instance['auth'] else ''
- remote = rietveld.Rietveld('https://' + instance['url'], email, None)
+ auth_config = auth.extract_auth_config_from_options(self.options)
+ remote = rietveld.Rietveld('https://' + instance['url'], auth_config, email)
# See def search() in rietveld.py to see all the filters you can use.
query_modified_after = None
@@ -780,6 +785,7 @@ def main():
help='Use markdown-friendly output (overrides --output-format '
'and --output-format-heading)')
parser.add_option_group(output_format_group)
+ auth.add_auth_options(parser)
# Remove description formatting
parser.format_description = (
« no previous file with comments | « git_cl.py ('k') | my_reviews.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698