Last change
on this file was
1,
checked in by myroslav, 19 years ago
|
Building directory structure
|
File size:
972 bytes
|
Rev | Line | |
---|
[1] | 1 | from StringIO import StringIO |
---|
| 2 | from Products.Archetypes import listTypes |
---|
| 3 | from Products.Archetypes.Extensions.utils import installTypes, install_subskin |
---|
| 4 | from Products.CMFCore.utils import getToolByName |
---|
| 5 | |
---|
| 6 | from Products.qTopic.config import * |
---|
| 7 | |
---|
| 8 | def 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 | |
---|
| 21 | def 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.