mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Make labels display useful (#1260)
With the existing code you get these columns: labels.cloudidentity.googleapis.com/groups.discussion_forum,labels.cloudidentity.googleapis.com/groups.security but there is no data in the columns so you can't tell whcih groups have which values; by translating '' to True you can.
This commit is contained in:
@@ -237,6 +237,11 @@ def print_():
|
|||||||
for groupEntity in entityList:
|
for groupEntity in entityList:
|
||||||
i += 1
|
i += 1
|
||||||
groupEmail = groupEntity['groupKey']['id']
|
groupEmail = groupEntity['groupKey']['id']
|
||||||
|
for k, v in iter(groupEntity.pop('labels', {}).items()):
|
||||||
|
if v == '':
|
||||||
|
groupEntity[f'labels.{k}'] = True
|
||||||
|
else:
|
||||||
|
groupEntity[f'labels.{k}'] = v
|
||||||
group = utils.flatten_json(groupEntity)
|
group = utils.flatten_json(groupEntity)
|
||||||
for a_key in group:
|
for a_key in group:
|
||||||
if a_key not in titles:
|
if a_key not in titles:
|
||||||
@@ -304,7 +309,7 @@ def print_():
|
|||||||
csvRows.append(group)
|
csvRows.append(group)
|
||||||
if sortHeaders:
|
if sortHeaders:
|
||||||
display.sort_csv_titles([
|
display.sort_csv_titles([
|
||||||
'Email',
|
'name', 'groupKey.id'
|
||||||
], titles)
|
], titles)
|
||||||
display.write_csv_file(csvRows, titles, 'Groups', todrive)
|
display.write_csv_file(csvRows, titles, 'Groups', todrive)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user