Skip to content

Commit

Permalink
Improved output formatting for people objects
Browse files Browse the repository at this point in the history
  • Loading branch information
taers232c committed Feb 14, 2025
1 parent 57e1625 commit a70bbf0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/GamUpdate.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
7.04.02

Improved output formatting for the following commands:
```
gam info peoplecontact
gam show peoplecontacts
gam info peopleprofile
gam show peopleprofile
gam <UserTypeEntity> info contacts
gam <UserTypeEntity> show contacts
gam <UserTypeEntity> show peopleprofile
```

7.04.01

Fixed bug where multiple `querytime<String>` values in a query were not properly processed;
Expand Down
21 changes: 19 additions & 2 deletions src/gam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"""

__author__ = 'GAM Team <[email protected]>'
__version__ = '7.04.01'
__version__ = '7.04.02'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'

#pylint: disable=wrong-import-position
Expand Down Expand Up @@ -21864,12 +21864,29 @@ def _printPerson(entityTypeName, user, person, csvPF, FJQC, parameters):
'JSON': json.dumps(cleanJSON(person),
ensure_ascii=False, sort_keys=True)})

PEOPLE_CONTACT_OBJECT_KEYS = {
'addresses': 'type',
'calendarUrls': 'type',
'emailAddresses': 'type',
'events': 'type',
'externalIds': 'type',
'genders': 'value',
'imClients': 'type',
'locations': 'type',
'miscKeywords': 'type',
'nicknames': 'type',
'organizations': 'type',
'relations': 'type',
'urls': 'type',
'userDefined': 'key',
}

def _showPerson(userEntityType, user, entityType, person, i, count, FJQC, parameters):
_processPersonMetadata(person, parameters)
if not FJQC.formatJSON:
printEntity([userEntityType, user, entityType, person['resourceName']], i, count)
Ind.Increment()
showJSON(None, person)
showJSON(None, person, dictObjectsKey=PEOPLE_CONTACT_OBJECT_KEYS)
Ind.Decrement()
else:
printLine(json.dumps(cleanJSON(person), ensure_ascii=False, sort_keys=True))
Expand Down

0 comments on commit a70bbf0

Please sign in to comment.