[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: Greg Stein <gstein_at_lyra.org>
Date: 2003-04-09 21:09:51 CEST

On Wed, Apr 09, 2003 at 04:49:15PM +0200, Michael Wood wrote:
> On Wed, Apr 09, 2003 at 04:42:21PM +0200, Michael Wood wrote:
> > On Tue, Apr 08, 2003 at 08:39:04PM -0700, Blair Zajac wrote:
> > > cmpilato@collab.net wrote:
> > > > 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 =

Cool!

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

"cfg" is an instance of Config, not the ConfigParser class. Yes, the latter
would throw such an error. But Config.get is quite a bit different. It does
interpolation and handles per-group overrides and defaults. If nothing is
present, it specifically returns "".

>...
> I meant: (At least I think I did ;)
>
> self.from_addr = self.cfg.get('from_addr', group, params) or \
> self.repos.author or 'no_author'

Just right! I see Blair committed this version. Sweet.

I could bikeshed on "no_author", but hey... :-)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 9 21:06:46 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.