[Mailman-Developers] Mailman 3 and New Lists (Templates for Defining?)

Tom Browder tom.browder at gmail.com
Wed Mar 6 02:51:45 CET 2013


On Tue, Mar 5, 2013 at 2:23 PM, Barry Warsaw <barry at list.org> wrote:
> On Mar 02, 2013, at 10:38 AM, Tom Browder wrote:
...
>>I guess the real question for me is: is there a templating system in MM 3 so
>>that different list types can be defined?
...
> Yes, these are called "list styles".  See the IStyle interface in
> src/mailman/interfaces/styles.py for the API and src/mailman/styles/default.py
> for the two built-in styles, both essentially legacy styles.

Ah, that's where it is!  (And I assume ALL "attributes" are defined
there.)  But to my non-Python eyes I see only one actually defined.

But there is where we could add some other mailman-defined styles, correct?

> Note that styles are only applied when a list is created, so it is better to
> think of them as the default set of attributes for a list.  IOW, if you
> changed a style after a list is created, the list attributes do not change.
> In fact, the mailing list doesn't record what styles were applied to it.

That makes sense to me.

> The mailman.cfg file has a [styles] section, with a `paths` variable and a
> `default` variable.  The `paths` variable names Python dotted-module paths
> which are searched for IStyle implementations.  Thus, if you arranged for your
> MM3 installation to include on sys.path, the package mylocal.mailman.styles,
> you could put your own styles in there and Mailman should find them
> automatically.

Great!

> At that point, you can use one of your named styles as the default (via the
> `[styles]default` variable), or you can specify the style to use when creating
> a new list through the REST API.  See src/mailman/rest/docs/list.rst for
> details.

Thanks, Barry!

Best regards,

-Tom


More information about the Mailman-Developers mailing list