<HTML>
<HEAD>
<TITLE>Re: [Openstack] Tempita usage?</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Cool, does anyone have a good recommendation for the “best” xsd to python?<BR>
Actually that looks like releax NG.<BR>
<a href="http://libvirt.org/git/?p=libvirt.git;a=tree;f=docs/schemas;h=5085252d9917c216eb45305d9204c56bccf91551;hb=HEAD">http://libvirt.org/git/?p=libvirt.git;a=tree;f=docs/schemas;h=5085252d9917c216eb45305d9204c56bccf91551;hb=HEAD</a><BR>
Seeing that I haven’t had experience with this anyone have any good prior experiences?<BR>
<BR>
On 1/4/12 12:04 PM, "Duncan McGreggor" <<a href="duncan@dreamhost.com">duncan@dreamhost.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Fwiw, I'm +1 on this :-)<BR>
<BR>
I look forward to reviewing the branch...<BR>
<BR>
d<BR>
<BR>
On 04 Jan 2012 - 14:51, Jay Pipes wrote:<BR>
> No argument from me. Feel free to propose a branch that does the<BR>
> things you describe below. I'm sure you'll get feedback in code review<BR>
> :)<BR>
><BR>
> Cheers!<BR>
> -jay<BR>
><BR>
> On Tue, Jan 3, 2012 at 2:17 PM, Joshua Harlow <<a href="harlowja@yahoo-inc.com">harlowja@yahoo-inc.com</a>> wrote:<BR>
> > I was wondering if there has been any thought or consideration of removing<BR>
> > tempita and replacing it with ???just python???.<BR>
> > Personally the current tempita usage (libvirt.xml.template) seems to be<BR>
> > heading down a hairy path and I wanted to see others opinions on say<BR>
> > replacing this with something that doesn???t require a whole templating<BR>
> > language to use. Some of this may just be my bias against templating<BR>
> > languages from experience in different projects @ yahoo (they always start<BR>
> > to get hairy, especially when u start to code in them).<BR>
> ><BR>
> > Some thoughts:<BR>
> ><BR>
> > Assuming we can get a libvirt.domain.xsd (?) we can use a xsd->object model<BR>
> > utility to transform that xsd into a python object model (there seem to be a<BR>
> > couple of these?)<BR>
> ><BR>
> > <a href="http://www.rexx.com/~dkuhlman/generateDS.html">http://www.rexx.com/~dkuhlman/generateDS.html</a> or <a href="http://pyxsd.org/">http://pyxsd.org/</a> (or<BR>
> > something else?)<BR>
> ><BR>
> > Create a exposed ???tree??? representation of the sections of the libvirt domain<BR>
> > xml that we are interested in (and only those that we are interested in) as<BR>
> > python objects and have current code create these objects (which right now<BR>
> > is basically a set of python hashes getting sent to the tempita library)<BR>
> > Pass the root element of this exposed ???tree??? representation to a formatter<BR>
> > class (which itself could use pyxsd objects, or tempita ??? for backward<BR>
> > compatibility, or something else, but I have a strong preference for keeping<BR>
> > a single language in use, instead of a tempita language and a python<BR>
> > language).<BR>
> > Write output created by formatter class to domain.xml file (and continue as<BR>
> > normal).<BR>
> > Profit!<BR>
> ><BR>
> ><BR>
> > Some of the benefits I think exist with this:<BR>
> ><BR>
> > XML escaping will actually happen (does this happen right now?)<BR>
> > We can have a underlying object layer which comes directly from the<BR>
> > libvirt.domain.xsd (and possibly have versions of this to work with<BR>
> > different libvirt versions)<BR>
> > We can have an exposed object layer which will attempt to be version<BR>
> > independent of the underlying layer and only contain methods/properties that<BR>
> > we will use with libvirt (ie the xsd will have many properties/fields we<BR>
> > will not use, thus we should not expose them).<BR>
> > We can have a formatter layer that will know how to use this exposed layer<BR>
> > and return a object that can convert the exposed layer into a string, thus<BR>
> > allowing for different implementations (or at least a separation of what is<BR>
> > exposed, how its formatted and what the formatter internally uses).<BR>
> > We can have the if statements and loops and such that are starting to get<BR>
> > put in the template code in python code (thus u don???t have to context switch<BR>
> > into a templating language to make changes, thus making it easier to work<BR>
> > with libvirt).<BR>
> > Possible remove a dependency (always good).<BR>
> ><BR>
> ><BR>
> > Thoughts?<BR>
> ><BR>
> > -Josh<BR>
> ><BR>
> > _______________________________________________<BR>
> > Mailing list: <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
> > Post to ?? ?? : <a href="openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><BR>
> > Unsubscribe : <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
> > More help ?? : <a href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a><BR>
> ><BR>
><BR>
> _______________________________________________<BR>
> Mailing list: <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
> Post to     : <a href="openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><BR>
> Unsubscribe : <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
> More help   : <a href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>