Skip to content
Snippets Groups Projects
Commit 512c21b4 authored by Conrad Holmberg's avatar Conrad Holmberg
Browse files

Added pagination to All members function. Prints a dump of all addreses.

parent a917ede1
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
from mailmanclient import Client from mailmanclient import Client
import os import os
import sys import sys
import time
import argparse import argparse
try: try:
import json import json
...@@ -72,9 +73,17 @@ if __name__ == '__main__': ...@@ -72,9 +73,17 @@ if __name__ == '__main__':
elif email_list.upper() == 'ALL': elif email_list.upper() == 'ALL':
print "I couldn't get this to finsih!!!." print "I couldn't get this to finsih!!!."
members_hash={} members_hash={}
page = ml.get_held_page(count=100,page=1) # grabs users per page
for user in page: page = client.get_user_page(count=100, page=1)
print(user.display_name)
#loop through each page
while len(page) > 0:
for member in page:
print json.dumps(member.addresses.rest_data, indent=2)
time.sleep(.100) #pause between pages
page = page.next
# # Get json data from each member # # Get json data from each member
# for member in client.members: # for member in client.members:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment