Commit 8ba1ddb3 authored by wychen@chromium.org's avatar wychen@chromium.org

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
parent a872e757
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment