[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] mailer.py to use revision author for from_addr

From: <cmpilato_at_collab.net>
Date: 2003-04-09 05:27:41 CEST

Blair Zajac <blair@orcaware.com> writes:

> Can somebody with some Python fu check this? This sets the from address
> to the revision author if no from_addr is set or it is set like this
> from_addr =
>
> I'm not certain about the == None and == "" tests.
>
> Blair
>
>
> Index: mailer.py
> ===================================================================
> --- mailer.py (revision 5592)
> +++ mailer.py (working copy)
> @@ -157,6 +157,10 @@
> def start(self, group, params):
> self.to_addr = self.cfg.get('to_addr', group, params)
> self.from_addr = self.cfg.get('from_addr', group, params)
> + if self.from_addr == None or self.from_addr == "":
> + self.from_addr = self.repos.author
> + if self.from_addr == None or self.from_addr == "":
> + self.from_addr = 'no_author'
> self.reply_to = self.cfg.get('reply_to', group, params)

If I'm understanding the module docs correctly, the self.cfg.get()
will throw a NoOptionError if the option doesn't exist at all.
Presumably this is what you want to check for (as well as the ""
case).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 9 05:31:51 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.