[4suite] [Amara] How to subclass ALL binding classes

Uche Ogbuji uche at ogbuji.net
Fri Dec 8 23:36:12 MST 2006


Luis Miguel Morillas wrote:
> New amara offers the posibility of subclassing some binding classes,
> as Uche documented
> (http://uche.ogbuji.net/tech/4suite/etc/amara-manual.html#custom-binding-classes).
> 
> 
> But if I want to subclass ALL the classes (for example to add a new
> method to all the nodes), how can I use the parse method?
> 
> amara.parse(XML, binding_classes={(None, ???):  new_class})

Good question.  For now you'd have to monkeypatch bindery.container_base
among other things.  I probably won't change that for Amara 1.2.  For
2.0 Domlette Node will be the common base class, and I think we'll have
a factory mechanism to swap in something different.


-- 
Uche Ogbuji                               Work: The Kadomo Group, Inc.
http://uche.ogbuji.net                    http://kadomo.com
http://copia.ogbuji.net                   Lead dev at http://4Suite.org
Articles: http://uche.ogbuji.net/tech/publications/


More information about the 4suite mailing list