View a user's subscription options
Is there a command line script that can be used to view an individual user's subscription options for a specific list?
Gretchen Beck Carnegie Mellon
On 12/01/2015 08:51 AM, Gretchen R Beck wrote:
Is there a command line script that can be used to view an individual user's subscription options for a specific list?
I'm not aware of one, but it is fairly simple to do. I'm willing to add it to the collection at <https://www.msapiro.net/scripts/>, but what do you want in the way of output. Presumably the input would be something like
get_user_options listname user@example.com
but what kind of output are you looking for? What fields and in what format?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 12/01/2015 05:23 PM, Mark Sapiro wrote:
On 12/01/2015 08:51 AM, Gretchen R Beck wrote:
Is there a command line script that can be used to view an individual user's subscription options for a specific list?
I'm not aware of one, but it is fairly simple to do. I'm willing to add it to the collection at <https://www.msapiro.net/scripts/>, but what do you want in the way of output. Presumably the input would be something like
get_user_options listname user@example.com
but what kind of output are you looking for? What fields and in what format?
Based on a reply from Gretchen, I have implemented a first cut at this. The script can be found at <https://www.msapiro.net/scripts/user_options> (mirrored at <http://fog.ccsf.edu/~msapiro/scripts/user_options>). The script displays essentially all the user information on the user's options page including optionally the password.
To use it, download it to Mailman's bin/ directory, make sure it has execute permission and then run 'bin/user_options -h' for more info.
Comments welcome.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 12/2/2015 2:59 PM, Mark Sapiro wrote:
Based on a reply from Gretchen, I have implemented a first cut at this. The script can be found at <https://www.msapiro.net/scripts/user_options> (mirrored at <http://fog.ccsf.edu/~msapiro/scripts/user_options>). The script displays essentially all the user information on the user's options page including optionally the password.
To use it, download it to Mailman's bin/ directory, make sure it has execute permission and then run 'bin/user_options -h' for more info.
I tried this and got:
[root@xxxxxxx mailman]# bin/user_options -h Traceback (most recent call last): File "bin/user_options", line 98, in ? main() File "bin/user_options", line 52, in main ns, args = parseargs() File "bin/user_options", line 38, in parseargs formatter=optparse.IndentedHelpFormatter()) TypeError: __init__() got an unexpected keyword argument 'epilog'
This is under Python 2.4.3. (Should the file be called user_options or user_options.py? I tried it both ways and got the same result.)
-- Larry Kuenning larry@qhpress.org
On 12/03/2015 06:21 AM, Larry Kuenning wrote:
I tried this and got:
[root@xxxxxxx mailman]# bin/user_options -h Traceback (most recent call last): File "bin/user_options", line 98, in ? main() File "bin/user_options", line 52, in main ns, args = parseargs() File "bin/user_options", line 38, in parseargs formatter=optparse.IndentedHelpFormatter()) TypeError: __init__() got an unexpected keyword argument 'epilog'
This is under Python 2.4.3. (Should the file be called user_options or user_options.py? I tried it both ways and got the same result.)
It doesn't matter what you name the file or whether it has a .py extension. This is only significant for withlist scripts.
The problem is your Python version. optparse.OptionParser didn't have an 'epilog' attribute in Python 2.4. That requires Python 2.5.
If you just remove the lines 36 and 37:
epilog=Utils.wrap("""This script must be put in Mailman's bin/
directory."""),
from the script, it should work with Python 2.4, although the -h/--help output won't contain that line.
Sorry about that. This dependency doesn't appear to be documented at <https://docs.python.org/2/library/optparse.html#creating-the-parser>. I'll add some comment to the script.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Gretchen R Beck
-
Larry Kuenning
-
Mark Sapiro