I could really need some ideas for making a skinnable Python product. I am developing a Product, once more, but this time I am trying to make it skinable. I have written a basic module that can be re-used for all kinds of functionality. What I need is some way to select a skin. First I thought of making the product subclass the objectManager and then make another objectmanager inside that that holds the skins. Like:: myProduct/ skins/ skin1 skin2 ... Then by means of pushing the right skin folder onto the namespace the product could use different skins. But it seems like a waste of resources to have the dtml files duplicated all over the site. So I wondered if it might be possible to do something like the below pseudo-code. Or maybe somebody else has a better idea?? class myProduct: skins = objectManager() skins._setObject('skin1', objectManager()) skins.skin1._setObject(HTMLFile('skin1/index_html')) skins.skin1._setObject(HTMLFile('skin1/view')) skins.skin1._setObject(HTMLFile('skin1/edit')) skins._setObject('skin2', objectManager()) What I want to acheive is to have the skins a class properties, not instance properties. This way I could make a bunch of skins that could be selected from by setting a 'skin' property to the name of the 'skin' in the 'skins' folder. like:: skin = 'skin1' I don't need tested ideas, but would really like some input for ideas as for how to do this. regards Max M
On Monday 27 August 2001 23:06, you wrote:
I could really need some ideas for making a skinnable Python product.
I am developing a Product, once more, but this time I am trying to make it skinable. I have written a basic module that can be re-used for all kinds of functionality.
[etc]
I don't need tested ideas, but would really like some input for ideas as for how to do this.
What you're describing here is almost exactly what CMF's portal skin tool does, so you could just write the product to CMF's api's and get that stuff for free. Alternatively you could attempt to snarf the code from the skin tool into your own product so it can run without needing CMF. John
participants (2)
-
John Morton -
Max Møller Rasmussen