Re: [Modeling-users] Customizing autogenerated classes
Status: Abandoned
Brought to you by:
sbigaret
|
From: <so...@la...> - 2003-03-27 21:38:52
|
On Thu, Mar 27, 2003 at 12:18:06PM +0100, Sebastien Bigaret wrote: > > soif> I think i will modify the bricks to handle this, during the week i > soif> hope. > > Now I agree that this could/should be handled at generation time, > because this problem is a generic one. We should be able to offer the > users an example of such an architecture, as soif suggested it, with a > different python "brick". Soif, if you're going to study this maybe we > could discuss that a bit --I'll suggest however not to modify the > existing python brick, but to derive a new one for this purpose. For > example, the following code-generation process could be implemented: > > - take an existing model (no 'Generation', no 'Base'), say AuthorBooks, > > - modify it to generate AuthorBooks.Base.AuthorBase and BookBase, > where package AuthorBooks.Base is where live all the files that will > be overriden unconditionally when re-generating the model (including > the model) --we could simply use the existing python brick for that > purpose. > > - Last, generate the modules/subclasses Author & Book in package > AuthorBooks if and only if the modules do not already exists. > > > What do you think? Hum join you will find - PyModelMason patched: - fix bug #710817 that I discover 2 weeks ago but forget to report - added the building of Package.Base folder - integrated the inher_module.tmpl - module.tmpl patched: Added 'Base' where it should be - inher_module.tmpl This is the result of the model_AuthorBooks.xml tree /tmp/AuthorBooks/ /tmp/AuthorBooks/ |-- Base | |-- BookBase.py | |-- WriterBase.py | `-- __init__.py |-- Book.py |-- DEPENDENCIES.txt |-- INSTALL.txt |-- README.txt |-- TODO.txt |-- VERSION.txt |-- Writer.py |-- __init__.py |-- model_AuthorBooks.py |-- model_AuthorBooks.xml `-- setup.py Short note: I haven't created a new Mason/bricks because 1) This really need some rewrites (PyModelMason.py), perhaps I should wait for that. 2) I really think this should be the default behaviour 3) I dont' have so much time, and i lost some with the 2 bugs reported this afternoon. Please test and report bugs /Enjoy |