Branko Cibej wrote:
> Mathias Weinert wrote:
> > Adding a new option 'to_addrs' is okay for me. So the following questions
> > have to be answered:
> > o Do we use to_addr only if to_addrs isn't set or do we combine them?
> > -> I would say use only one of them.
> > o Which character will be used for splitting?
> > -> Although several (most) mail clients use ',' I could also accept to
> > use the semicolon ';'. So is it ',' or ';'?
> > o Do we want to use your code example to make the splitting process more
> > smart?
> > -> In order to not make it too complicated I would say 'No' (although
> > I appreciate your code example).
> > What do you think?
> I think it's a waste of time to write this kind of parser in Python. :)
> Teach mailer.py to expect a Python list in the to_addr option it the
> character in the option value is a bracket. So, if you write:
> to_addr = [ 'list',
> 'addresses' ]
> you can simply evaluate the option's value and get a Python list object.\
> On the con side, the list elements would have to be valid Python
> strings, using Python's quoting rules.
At first thought, yes, great idea. No changes of config file needed
(except a comment about the new feature), no deprecation and my goal
But then I tried to implement the "you can simply evaluate
the option's value and get a Python list object." idea...
After doing some internet research I found out that there doesn't seem
to be any simple way to do this.
So unless you are able to tell me how to simply do the string to list
conversion we have to find another solution.
Perhaps the following is suitable:
If the to_addr argument starts with '[' we take the next character as
split char and ignore everything until ']' (or any other symbol).
With this I would still get the above described benefits.
to_addr = "a" b@c, "x" y@z
['"a"', 'b@c,', '"x"', 'y@z']
to_addr = [,] "a" b@c, "x" y@z
['"a" b@c', '"x" y@z']
What do you think about this?
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Thu Jun 8 16:25:07 2006