add --only-sponsors flag
Filter results based on companies that sponsor the foundation at gold or platinum level. Change-Id: Ieacdfc3f512fc102656d3bcfcd9fccdacac20f43 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
4e25b3f101
commit
979d1c8239
@ -45,3 +45,7 @@ class Sponsors:
|
|||||||
if name.lower() in self._names:
|
if name.lower() in self._names:
|
||||||
return name
|
return name
|
||||||
return '*other'
|
return '*other'
|
||||||
|
|
||||||
|
@functools.lru_cache(maxsize=1024)
|
||||||
|
def __contains__(self, name):
|
||||||
|
return name.lower() in self._names
|
||||||
|
@ -32,13 +32,20 @@ class ContributionsReportBase(lister.Lister):
|
|||||||
action='append',
|
action='append',
|
||||||
help='filter to only include specific roles (may be repeated)',
|
help='filter to only include specific roles (may be repeated)',
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
sponsor_group = parser.add_mutually_exclusive_group()
|
||||||
|
sponsor_group.add_argument(
|
||||||
'--highlight-sponsors',
|
'--highlight-sponsors',
|
||||||
default=False,
|
default=False,
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help=('highlight sponsor organizations and '
|
help=('highlight sponsor organizations and '
|
||||||
'combine stats for others'),
|
'combine stats for others'),
|
||||||
)
|
)
|
||||||
|
sponsor_group.add_argument(
|
||||||
|
'--only-sponsors',
|
||||||
|
default=False,
|
||||||
|
action='store_true',
|
||||||
|
help=('show only stats for sponsor organizations'),
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--sponsor-level',
|
'--sponsor-level',
|
||||||
default='all',
|
default='all',
|
||||||
@ -97,6 +104,15 @@ class ContributionsReportBase(lister.Lister):
|
|||||||
if ignore_teams:
|
if ignore_teams:
|
||||||
data = (d for d in data if d['Team'].lower() not in ignore_teams)
|
data = (d for d in data if d['Team'].lower() not in ignore_teams)
|
||||||
|
|
||||||
|
if parsed_args.only_sponsors:
|
||||||
|
sponsor_map = sponsors.Sponsors(parsed_args.sponsor_level)
|
||||||
|
|
||||||
|
data = (
|
||||||
|
d
|
||||||
|
for d in data
|
||||||
|
if d['Organization'] in sponsor_map
|
||||||
|
)
|
||||||
|
|
||||||
ignore_tags = set(parsed_args.ignore_tag)
|
ignore_tags = set(parsed_args.ignore_tag)
|
||||||
if ignore_tags:
|
if ignore_tags:
|
||||||
team_data = governance.Governance(
|
team_data = governance.Governance(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user