source: products/qTopic/branches/plone2.0.5/Extensions/Install.py

Last change on this file was 1, checked in by myroslav, 18 years ago

Building directory structure

File size: 972 bytes
Line 
1from StringIO import StringIO
2from Products.Archetypes import listTypes
3from Products.Archetypes.Extensions.utils import installTypes, install_subskin
4from Products.CMFCore.utils import getToolByName
5
6from Products.qTopic.config import *
7
8def install(self):
9    out = StringIO()
10                         
11    installTypes(self, out, listTypes(PROJECTNAME), PROJECTNAME)
12    print >> out, 'Types Installed'
13
14    install_subskin(self, out, GLOBALS)
15    print >> out, 'Skins Installed'
16
17    out.write('Installation %s successfully completed.\n' % PROJECTNAME)
18    return out.getvalue()
19
20
21def uninstall(self):
22    skinstool = getToolByName(self, 'portal_skins')
23    for skinName in skinstool.getSkinSelections():
24        path = skinstool.getSkinPath(skinName)
25        path = [i.strip() for i in  path.split(',')]
26        if SKINS_SUBDIR in path:
27            path.remove(SKINS_SUBDIR)
28            path = ','.join(path)
29            skinstool.addSkinSelection(skinName, path)
30
31
32
Note: See TracBrowser for help on using the repository browser.