[Zope-CMF] Installation script

Tres Seaver tseaver@palladion.com
Wed, 22 Aug 2001 13:00:16 -0400 (EDT)


On Wed, 22 Aug 2001, Thomas Olsen wrote:

> I'm afraid that I'm absolutely clueless about what you mean ;-)

I was trying to give you a way to parameterize your install
script, by having it prompt for parameters when invoked without
them.

> What I'm doing now is something like:
> 
> if 'article' not in skinstool.objectIds():
>     createDirectoryView(skinstool, 'skins/article', article_globals)
>     out.write("Added 'article' directory view to portal_skins\n")
> 
> ---snip------------------------
> skins = skinstool.getSkinSelections()
> for skin in skins:
>     path = skinstool.getSkinPath(skin)
>     path = map(string.strip, string.split(path,','))
>     if 'article' not in path:
>         try: path.insert(path.index('content'), 'article')
>         except ValueError:
>             path.append('article')
> 
>         path = string.join(path, ', ')
>         skinstool.addSkinSelection(skin, path)
>         out.write("Added 'article' to %s skin\n" % skin)
>     else:
>         out.write("Skipping %s skin, 'article' is already set up\n" % (
>             skin))
> return out.getvalue()
> ---snap------------------------
> 
> This works fine if I only had to add e.g. dtml skins. When I also want to add 
> zptskins I cant find out which skinpaths to add them to

So your script could provide a list of the existing skins, and
prompt the user to select those into which it should install
its folder;  perhaps the user could indicate the "insertion point"
as well.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com