mirror of
https://codeberg.org/langfingaz/bbb-status
synced 2024-11-21 20:23:17 +01:00
printModerators: reduce Users to fullName
This commit is contained in:
parent
fa38fc4f6e
commit
794225b96b
@ -34,6 +34,7 @@ def getModerators(dataDir: Path = fileUtil.getDataDir()) -> Dict[parseMeetings.U
|
||||
if attendee.role == "MODERATOR"]
|
||||
|
||||
moderatorCount: Dict[parseMeetings.User, int] = {}
|
||||
moderator: parseMeetings.User
|
||||
for moderator in moderators:
|
||||
count: int = 1
|
||||
if moderator in moderatorCount:
|
||||
@ -46,5 +47,20 @@ def getModerators(dataDir: Path = fileUtil.getDataDir()) -> Dict[parseMeetings.U
|
||||
|
||||
|
||||
def printModerators():
|
||||
moderators: Dict[parseMeetings.User, int] = getModerators()
|
||||
[print(moderator.fullName + ":\t" + str(count)) for moderator, count in moderators.items()]
|
||||
"""
|
||||
There may be multiple (different) User objects (with different UserIds) that have the
|
||||
same name. This may come from one user joining different meetings.
|
||||
|
||||
This method reduces Users to their fullNames.
|
||||
"""
|
||||
|
||||
moderatorUsers: Dict[parseMeetings.User, int] = getModerators()
|
||||
|
||||
moderatorNames: Dict[str, int] = {}
|
||||
user: parseMeetings.User
|
||||
for user, count in moderatorUsers.items():
|
||||
if user.fullName in moderatorNames:
|
||||
count += moderatorNames[user.fullName]
|
||||
moderatorNames[user.fullName] = count
|
||||
|
||||
[print(fullName + ":\t" + str(count)) for fullName, count in moderatorNames.items()]
|
||||
|
Loading…
Reference in New Issue
Block a user