add possibility to filter on module

This commit is contained in:
Frédéric Péters 2017-10-14 23:18:41 +02:00
parent 34cbd3720a
commit 02a83739d1
1 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@ from eodb.events.models import Commit
class GraphCommand(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('--username', metavar='USERNAME')
parser.add_argument('--module', metavar='MODULE')
parser.add_argument('--datemin', metavar='DATEMIN')
parser.add_argument('--datemax', metavar='DATEMAX')
parser.add_argument('--committime', action='store_true',
@ -20,6 +21,9 @@ class GraphCommand(BaseCommand):
if options.get('username'):
filters['author_email__startswith'] = options['username'] + '@'
if options.get('module'):
filters['module'] = options['module']
datetime_var = 'author_datetime'
if options.get('committime'):
datetime_var = 'commit_datetime'
@ -34,6 +38,8 @@ class GraphCommand(BaseCommand):
title = 'Git activity'
if options.get('username'):
title += ' for %s' % options['username']
if options.get('module'):
title += ' in module %s' % options['module']
if options.get('datemin'):
title += ' from %s' % options['datemin']
if options.get('datemax'):