[Mailman-Users] mmfold.py with MM 2.1.12

Mark Sapiro mark at msapiro.net
Sat Sep 26 22:51:17 CEST 2009


Rob Lingelbach wrote:
>
>On Sep 26, 2009, at 5:04 PM, Mark Sapiro wrote:
>
>>        webbrowser.open("file://" + htmlfile)
>>
>> Links didn't like file:////tmp/... as a URL.
>>
>> Also if you supply the password in the command line, you probably need
>> to escape the '?' for the shell as in
>>
>> $ ./mmfold.py http://www.grizz.org/mailman/admindb/list\?admpw=...
>
>did do that, escaping the ? from the first attempt.  but now,


That's all for stuff that comes later. This problem


>rob at soho89-16-227-18 21:10 pts/1 /var/www/mailman/bin# ./mmfold.py -p  
>(password) http://tig.colorist.org/mailman/admindb/tig
>Traceback (most recent call last):
>   File "./mmfold.py", line 181, in ?
>     sys.exit(main())
>   File "./mmfold.py", line 64, in main
>     lst = x.path.split("/")[-1]
>AttributeError: 'tuple' object has no attribute 'path'


is because x is the return from urlparse.urlparse() which prior to
Python 2.5 was a straight tuple rather than a subclass of tuple with
attributes.

You either need to run this with Python 2.5 or later or you need to
modify mmfold.py replacing

    lst = x.path.split("/")[-1]
with
    lst = x[2].split("/")[-1]

    for keyval in x.query.split("&"):
with
    for keyval in x[4].split("&"):

and

    url = urlparse.urlunparse((x.scheme, x.netloc, x.path, x.params,
                               query, x.fragment))
with
    url = urlparse.urlunparse((x[0], x[1], x[2], x[3],
                               query, x[5]))


-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list