Launchpad logo and name.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index ][Thread Index ]

Re: [Launchpad-users] The 'changes_file_url' property becomes a method



On Mon, Dec 21, 2009 at 05:52:10PM +0100, Muharem Hrnjadovic wrote:
> Kees Cook wrote:
> > On Mon, Dec 21, 2009 at 04:18:23PM +0100, Muharem Hrnjadovic wrote:
> >> Quick info: the branch with the changes announced below just landed on
> >> db-devel (revno: 8815)
> > 
> > Thanks for the heads-up!  Just for reference, I think this is a portable
> > way to handle either interface to the API:
> > 
> >     import types
> >     if type(item.changes_file_url) == types.MethodType:
> >         src_changes = item.changes_file_url()
> Hello Kees,
> 
> cool idea, please note that the method name is changesFileUrl().

Oh!  Heh, well, that actually makes it easier:

    if hasattr(item,'changes_file_url'):
        src_changes = item.changes_file_url
    else:
        src_changes = item.changesFileUrl()

Thanks,

-Kees

-- 
Kees Cook
Ubuntu Security Team



This is the launchpad-users mailing list archive — see also the general help for Launchpad.net mailing lists.

(Formatted by MHonArc.)