[libavg-devel] Constructor arguments and python attributes aligned

Nick Hebner hebnern at gmail.com
Wed Jul 29 23:45:39 CEST 2009


On Wed, Jul 29, 2009 at 2:12 PM, Ulrich von Zadow <uzadow at libavg.de> wrote:

> Hi,
>
> I've been working on bug #65 (https://www.libavg.de/mantis/view.php?id=65
> ) and added point and vector-typed constructor arguments. That means
> that things like pos, size and texcoord can now be passed to
> createNode or specified in an avg file, which I think is pretty cool.
>

I think that that is pretty cool too!

>
> To keep a clean interface, I also made sure that node constructor
> arguments are the same as the python attributes. That meant some api
> changes:
>
> - All AreaNodes now have pos and size attributes.
> - The former Words::size attribute had to be renamed to fontsize.
> - pivotx and pivoty have been replaced by pivot.
> - For all vector node types, x and y attributes have been replaced by
> pos attributes.
> - Also for vector nodes, I've added texcoord constructor params.
>
> Warning: The attributes that I've removed are dangerous. Since this is
> python, you can still set (for example) line.x1. It just won't do what
> you expected anymore. Still, I think the cleaner interface is worth
> it. (And if anyone has an idea on how to prevent usage of the removed
> attributes, I'd be happy to hear it.)
>

You might want to leave the old attributes defined and just throw an
explanatory exception inside of the getters/setters. These would of course
be removed entirely in a later version, but it would give people a chance to
update their scripts.

>
> Cheers,
>
>   Uli
>
> --
> Any technology distinguishable from magic is insufficiently advanced.
>
> Ulrich von Zadow | +49-172-7872715
> Jabber: coder at c-base.org
> Skype: uzadow
>
>
>
>
> _______________________________________________
> libavg-devel mailing list
> libavg-devel at datenhain.de
> https://mail.datenhain.de/mailman/listinfo/libavg-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.datenhain.de/pipermail/libavg-devel/attachments/20090729/370b3f32/attachment.html 


More information about the libavg-devel mailing list