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

Side by Side Diff: my_activity.py

Issue 1754433002: my_activity fetches issues from monorail (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
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 5
6 """Get stats about your activity. 6 """Get stats about your activity.
7 7
8 Example: 8 Example:
9 - my_activity.py for stats for the current week (last week on mondays). 9 - my_activity.py for stats for the current week (last week on mondays).
10 - my_activity.py -Q for stats for last quarter. 10 - my_activity.py -Q for stats for last quarter.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 'url': 'chrome-internal-review.googlesource.com', 95 'url': 'chrome-internal-review.googlesource.com',
96 'shorturl': 'crosreview.com/i', 96 'shorturl': 'crosreview.com/i',
97 }, 97 },
98 { 98 {
99 'url': 'android-review.googlesource.com', 99 'url': 'android-review.googlesource.com',
100 }, 100 },
101 ] 101 ]
102 102
103 google_code_projects = [ 103 google_code_projects = [
104 { 104 {
105 'name': 'brillo',
106 'shorturl': 'brbug.com',
107 },
108 {
109 'name': 'chromium', 105 'name': 'chromium',
110 'shorturl': 'crbug.com', 106 'shorturl': 'crbug.com',
111 }, 107 },
112 { 108 {
113 'name': 'chromium-os',
114 'shorturl': 'crosbug.com',
115 },
116 {
117 'name': 'chrome-os-partner',
118 },
119 {
120 'name': 'google-breakpad', 109 'name': 'google-breakpad',
121 }, 110 },
122 { 111 {
123 'name': 'gyp', 112 'name': 'gyp',
124 }, 113 },
125 { 114 {
126 'name': 'skia', 115 'name': 'skia',
127 }, 116 },
128 ] 117 ]
129 118
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 ret.append({ 392 ret.append({
404 'author': reply['author']['email'], 393 'author': reply['author']['email'],
405 'created': datetime_from_gerrit(reply['date']), 394 'created': datetime_from_gerrit(reply['date']),
406 'content': reply['message'], 395 'content': reply['message'],
407 }) 396 })
408 return ret 397 return ret
409 398
410 def project_hosting_issue_search(self, instance): 399 def project_hosting_issue_search(self, instance):
411 auth_config = auth.extract_auth_config_from_options(self.options) 400 auth_config = auth.extract_auth_config_from_options(self.options)
412 authenticator = auth.get_authenticator_for_host( 401 authenticator = auth.get_authenticator_for_host(
413 "code.google.com", auth_config) 402 "bugs.chromium.org", auth_config)
414 http = authenticator.authorize(httplib2.Http()) 403 http = authenticator.authorize(httplib2.Http())
415 url = "https://www.googleapis.com/projecthosting/v2/projects/%s/issues" % ( 404 url = ("https://monorail-prod.appspot.com/_ah/api/monorail/v1/projects"
416 instance["name"]) 405 "/%s/issues") % instance["name"]
417 epoch = datetime.utcfromtimestamp(0) 406 epoch = datetime.utcfromtimestamp(0)
418 user_str = '%s@chromium.org' % self.user 407 user_str = '%s@chromium.org' % self.user
419 408
420 query_data = urllib.urlencode({ 409 query_data = urllib.urlencode({
421 'maxResults': 10000, 410 'maxResults': 10000,
422 'q': user_str, 411 'q': user_str,
423 'publishedMax': '%d' % (self.modified_before - epoch).total_seconds(), 412 'publishedMax': '%d' % (self.modified_before - epoch).total_seconds(),
424 'updatedMin': '%d' % (self.modified_after - epoch).total_seconds(), 413 'updatedMin': '%d' % (self.modified_after - epoch).total_seconds(),
425 }) 414 })
426 url = url + '?' + query_data 415 url = url + '?' + query_data
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 739
751 if __name__ == '__main__': 740 if __name__ == '__main__':
752 # Fix encoding to support non-ascii issue titles. 741 # Fix encoding to support non-ascii issue titles.
753 fix_encoding.fix_encoding() 742 fix_encoding.fix_encoding()
754 743
755 try: 744 try:
756 sys.exit(main()) 745 sys.exit(main())
757 except KeyboardInterrupt: 746 except KeyboardInterrupt:
758 sys.stderr.write('interrupted\n') 747 sys.stderr.write('interrupted\n')
759 sys.exit(1) 748 sys.exit(1)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698