In my_activity.py, multiple --last_week for more weeks

Also, if one --last_week option is given, the date range should be
strictly one week before when without the option.

BUG=

Review URL: https://codereview.chromium.org/1086083007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295052 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
wychen@chromium.org 10 years ago
parent a872e757cb
commit 8ba1ddb3d6

@ -723,8 +723,8 @@ def main():
'-w', '--week_of', metavar='<date>',
help='Show issues for week of the date')
parser.add_option(
'-W', '--last_week', action='store_true',
help='Show last week\'s issues')
'-W', '--last_week', action='count',
help='Show last week\'s issues. Use more times for more weeks.')
parser.add_option(
'-a', '--auth',
action='store_true',
@ -808,7 +808,8 @@ def main():
elif options.week_of:
begin, end = (get_week_of(datetime.strptime(options.week_of, '%m/%d/%y')))
elif options.last_week:
begin, end = (get_week_of(datetime.today() - timedelta(days=7)))
begin, end = (get_week_of(datetime.today() -
timedelta(days=1 + 7 * options.last_week)))
else:
begin, end = (get_week_of(datetime.today() - timedelta(days=1)))
else:

Loading…
Cancel
Save