[Mailman-Users] Digest options -> list configuration

Mark Sapiro mark at msapiro.net
Wed Aug 6 04:58:26 CEST 2008


Alan.Rubin at nt.gov.au wrote:
>
>Thanks for your answer.  It is very enlightening.
>
>This is a bit of a tangent, but also has to do with 'interpretation' of
>Mailman's configuration.  If you read/work with the list configuration from the
>command line, using ~mailman/bin/config_list,  you will see many descriptions
>that say something such as:
>
>      # legal values are:
>      #    0 = "No"
>      #    1 = "Yes"
>
>But then the current/default value will be listed as True or False, literally.
>Which is it?  Are both 0/False and 1/True acceptable?


Yes they are. At least assuming your Python is 2.3 or later, and
assuming the attribute is one with only "Yes" or "No" possibilities.
Prior to 2.3 there were no built-in constants True and False. Since
Mailman through 2.1.8 was compatible with Python back to 2.1, we used
0 and 1 instead of False and True as values or we used a kludge like

try:
    True, False
except NameError:
    True = 1
    False = 0

to define True and False if they weren't built in. Eventually, Mailman
will move to using True and False everywhere to represent truth value
constants, but even then, some old lists will still have 1 or 0 as the
value of some list attributes just because they were set that way at
one time and never changed.

However, all the above has to do with the actual attribute value shown
by config_list -o or set by config_list -i.

In the actual text

# legal values are:
#    0 = "No"
#    1 = "Yes"

the 0 and 1 are the index of the radio button in the GUI for that
attribute

in the same way as, e.g.

# legal values are:
#    0 = "Accept"
#    1 = "Hold"
#    2 = "Reject"
#    3 = "Discard"

are the possible settings for generic_nonmember_action and

# legal values are:
#    0 = "No"
#    1 = "Yes"
#    2 = "Full Personalization"

are the possible settings for personalize.

The bottom line is if you see a setting reported as True or False, it's
OK to set it to False or True with config_list, but if the setting is
reported as 0 or 1, you can't be sure that the code doesn't somewhere
treat it as a number, so it is best to set it to a number.

-- 
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