From 5dcb4a9703ed2d9a20a520aa1ceb4c706b74facc Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 29 Jul 2013 13:34:27 -0700 Subject: [PATCH] Use current username as default Instead of russelb. I mean, it's the user's fault they aren't russelb, but I think this change follows the robustness principle. Change-Id: I5a5b09836840220540980e6d0eb0e4d324dc2678 --- openapproved.py | 3 ++- openreviews.py | 3 ++- reviewers.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openapproved.py b/openapproved.py index 57b09f4..862c8ff 100755 --- a/openapproved.py +++ b/openapproved.py @@ -22,6 +22,7 @@ Prints out list of approved patches that failed to merge and are currently still open. Only show patches that are likely to be trivial rebases. """ +import getpass import optparse import sys @@ -37,7 +38,7 @@ def main(argv=None): help='JSON file describing the project to generate stats for') optparser.add_option('-a', '--all', action='store_true', help='Generate stats across all known projects (*.json)') - optparser.add_option('-u', '--user', default='russellb', help='gerrit user') + optparser.add_option('-u', '--user', default=getpass.getuser(), help='gerrit user') optparser.add_option('-k', '--key', default=None, help='ssh key for gerrit') optparser.add_option('-s', '--stable', action='store_true', help='Include stable branch commits') diff --git a/openreviews.py b/openreviews.py index 67083cf..9f3f510 100755 --- a/openreviews.py +++ b/openreviews.py @@ -18,6 +18,7 @@ import calendar import datetime +import getpass import optparse import os import os.path @@ -234,7 +235,7 @@ def main(argv=None): help='JSON file describing the project to generate stats for') optparser.add_option('-a', '--all', action='store_true', help='Generate stats across all known projects (*.json)') - optparser.add_option('-u', '--user', default='russellb', help='gerrit user') + optparser.add_option('-u', '--user', default=getpass.getuser(), help='gerrit user') optparser.add_option('-k', '--key', default=None, help='ssh key for gerrit') optparser.add_option('-s', '--stable', action='store_true', help='Include stable branch commits') diff --git a/reviewers.py b/reviewers.py index fe0b382..f9ce727 100755 --- a/reviewers.py +++ b/reviewers.py @@ -19,6 +19,7 @@ import calendar import datetime +import getpass import glob import json import optparse @@ -38,7 +39,7 @@ optparser.add_option('-a', '--all', action='store_true', help='Generate stats across all known projects (*.json)') optparser.add_option('-d', '--days', type='int', default=14, help='Number of days to consider') -optparser.add_option('-u', '--user', default='russellb', help='gerrit user') +optparser.add_option('-u', '--user', default=getpass.getuser(), help='gerrit user') optparser.add_option('-k', '--key', default=None, help='ssh key for gerrit') options, args = optparser.parse_args()