Hi, On 05/24/2012 09:13 PM, ShaoHe Fen3g wrote: > Hi all, > > Now I'm using the code generation suites of ovirt-engine-sdk, I find it is > very troublesome.
I completely agree with you, automating python entities generation is on top of my TODO stack see [1], Along with this, there was always something more important to do, and it was delayed time after time, so your help is most welcome. [1] http://www.ovirt.org/wiki/SDK#codegen > > IMO, we can simplify the process. And I want to engaged in it. > > there are two tools parse the api.xsd and generate the params.py code. They > are generateds_gui.py and generateDS.py. > but there still some code can not be generate by these tools. now we should > add these codes manually. > > the not NOT_GENERATED codes are as follow in the current params.py code: > 1. import python module > 2. a new attribute of GeneratedsSuper class > 3. modify the get_root_tag function. > 4. modify the parseString function to shut up the stdout. > 5. _rootClassMap > 6 . _elementToClassMap > 7. findRootClass > > And I have two ideas about the code generation. > For we should not modify the generateDS.py tools. > But we can improve it. > > I think the 1, 2, 3, 7, can be hard-code, and 4, 5 and 6 can be configured. > So I want to add an configure file to tell how to add the extra code that are > not generated by generateDS.py tools. > And new python program, as extension of generateDS.py to read the configure > file and generate these codes. sounds good, btw 5,6 can be constructed programmatically using __all__ generated by generateDS and finding element name in xsd by type (from __all__). > > Or without the configure file, just make the new python program that supports > an interactive commands. > > > > _______________________________________________ > Engine-devel mailing list > [email protected] > http://lists.ovirt.org/mailman/listinfo/engine-devel -- Michael Pasternak RedHat, ENG-Virtualization R&D _______________________________________________ Engine-devel mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-devel
