Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mailman-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
irt-public
mailman-tools
Commits
a917ede1
Commit
a917ede1
authored
6 years ago
by
Conrad Holmberg
Browse files
Options
Downloads
Patches
Plain Diff
Started pagination to All members function.
parent
03338d60
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
manage_users.py
+9
-4
9 additions, 4 deletions
manage_users.py
with
9 additions
and
4 deletions
manage_users.py
+
9
−
4
View file @
a917ede1
...
@@ -17,7 +17,7 @@ def get_email_lists(email_lists):
...
@@ -17,7 +17,7 @@ def get_email_lists(email_lists):
return
members
return
members
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
parser
=
argparse
.
ArgumentParser
(
description
=
"
Dump Mailing List based on alia
s.
"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"
Manage Users in Mailman Email List
s.
"
)
CORE_URI
=
os
.
environ
.
get
(
'
MAILMAN_CORE_URI
'
,
'
http://mailman-core:8001/3.1
'
)
CORE_URI
=
os
.
environ
.
get
(
'
MAILMAN_CORE_URI
'
,
'
http://mailman-core:8001/3.1
'
)
CORE_USER
=
os
.
environ
.
get
(
'
MAILMAN_REST_USER
'
,
'
restadmin
'
)
CORE_USER
=
os
.
environ
.
get
(
'
MAILMAN_REST_USER
'
,
'
restadmin
'
)
...
@@ -26,7 +26,7 @@ if __name__ == '__main__':
...
@@ -26,7 +26,7 @@ if __name__ == '__main__':
LIST_NAME
=
'
apachesvn@lists.med.stanford.edu
'
# just a tesing default
LIST_NAME
=
'
apachesvn@lists.med.stanford.edu
'
# just a tesing default
# user invoked variables
# user invoked variables
parser
.
add_argument
(
'
list_fqdn
'
,
default
=
LIST_NAME
)
parser
.
add_argument
(
'
--
list_fqdn
'
,
default
=
LIST_NAME
)
# Add arguments for env variables
# Add arguments for env variables
parser
.
add_argument
(
'
--core-uri
'
,
dest
=
'
core_uri
'
,
default
=
CORE_URI
)
parser
.
add_argument
(
'
--core-uri
'
,
dest
=
'
core_uri
'
,
default
=
CORE_URI
)
...
@@ -46,6 +46,7 @@ if __name__ == '__main__':
...
@@ -46,6 +46,7 @@ if __name__ == '__main__':
# lists members of a list
# lists members of a list
if
args
.
list_fqdn
:
if
args
.
list_fqdn
:
# used to store members
members_hash
=
{}
members_hash
=
{}
# obtain email list from argument
# obtain email list from argument
email_list
=
args
.
list_fqdn
email_list
=
args
.
list_fqdn
...
@@ -66,11 +67,15 @@ if __name__ == '__main__':
...
@@ -66,11 +67,15 @@ if __name__ == '__main__':
members_hash
[
'
address
'
]
=
member
.
address
.
rest_data
members_hash
[
'
address
'
]
=
member
.
address
.
rest_data
#held_data[held.request_id] = held.rest_data
#held_data[held.request_id] = held.rest_data
#members_hash['preferences']= member.preferences
#members_hash['preferences']= member.preferences
json
.
dumps
(
members_hash
,
indent
=
2
)
print
json
.
dumps
(
members_hash
,
indent
=
2
)
# Get all the member
# Get all the member
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
)
for
user
in
page
:
print
(
user
.
display_name
)
# # Get json data from each member
# # Get json data from each member
# for member in client.members:
# for member in client.members:
# members_hash['email']= member.email
# members_hash['email']= member.email
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment