OLD | NEW |
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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 ret['review_url'] = 'http://%s/%d' % (instance['url'], bug_id) | 670 ret['review_url'] = 'http://%s/%d' % (instance['url'], bug_id) |
671 ret['url'] = ret['review_url'] | 671 ret['url'] = ret['review_url'] |
672 ret['header'] = desc | 672 ret['header'] = desc |
673 ret['webkit_bug_id'] = bug_id | 673 ret['webkit_bug_id'] = bug_id |
674 return ret | 674 return ret |
675 | 675 |
676 def setup_webkit_info(self): | 676 def setup_webkit_info(self): |
677 assert(self.webkit_repo) | 677 assert(self.webkit_repo) |
678 git_dir = os.path.normpath(self.webkit_repo + "/.git") | 678 git_dir = os.path.normpath(self.webkit_repo + "/.git") |
679 if not os.path.exists(git_dir): | 679 if not os.path.exists(git_dir): |
680 print "%s doesn't exist, turning off WebKit checks." % git_dir | 680 print "%s doesn't exist, skipping WebKit checks." % git_dir |
681 self.webkit_repo = None | 681 self.webkit_repo = None |
682 return | 682 return |
683 | 683 |
684 try: | 684 try: |
685 self.git_cmd(self.webkit_repo, "fetch", "origin") | 685 self.git_cmd(self.webkit_repo, "fetch", "origin") |
686 except subprocess.CalledProcessError: | 686 except subprocess.CalledProcessError: |
687 print "Failed to update WebKit repo, turning off WebKit checks." | 687 print "Failed to update WebKit repo, skipping WebKit checks." |
688 self.webkit_repo = None | 688 self.webkit_repo = None |
689 return | 689 return |
690 | 690 |
691 path = "Tools/Scripts" | 691 path = "Tools/Scripts" |
692 full_path = os.path.normpath("%s/%s" % (self.options.webkit_repo, path)) | 692 full_path = os.path.normpath("%s/%s" % (self.options.webkit_repo, path)) |
693 sys.path.append(full_path) | 693 sys.path.append(full_path) |
694 | 694 |
695 try: | 695 try: |
696 global webkitpy | 696 global webkitpy |
697 webkitpy = __import__('webkitpy.common.config.committers') | 697 webkitpy = __import__('webkitpy.common.config.committers') |
698 except ImportError: | 698 except ImportError: |
699 print "Failed to import WebKit committer list, turning off WebKit checks." | 699 print "Failed to import WebKit committer list, skipping WebKit checks." |
700 self.webkit_repo = None | 700 self.webkit_repo = None |
701 return | 701 return |
702 | 702 |
703 if not webkit_account(self.user): | 703 if not webkit_account(self.user): |
704 email = self.user + "@chromium.org" | 704 email = self.user + "@chromium.org" |
705 print "No %s in committers.py, turning off WebKit checks." % email | 705 print "No %s in committers.py, skipping WebKit checks." % email |
706 self.webkit_repo = None | 706 self.webkit_repo = None |
707 | 707 |
708 @staticmethod | 708 @staticmethod |
709 def print_change(change): | 709 def print_change(change): |
710 print '%s %s' % ( | 710 print '%s %s' % ( |
711 change['review_url'], | 711 change['review_url'], |
712 change['header'], | 712 change['header'], |
713 ) | 713 ) |
714 | 714 |
715 @staticmethod | 715 @staticmethod |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 print '\n\n\n' | 940 print '\n\n\n' |
941 | 941 |
942 my_activity.print_changes() | 942 my_activity.print_changes() |
943 my_activity.print_reviews() | 943 my_activity.print_reviews() |
944 my_activity.print_issues() | 944 my_activity.print_issues() |
945 return 0 | 945 return 0 |
946 | 946 |
947 | 947 |
948 if __name__ == '__main__': | 948 if __name__ == '__main__': |
949 sys.exit(main()) | 949 sys.exit(main()) |
OLD | NEW |