Last change
on this file since 1232 was
653,
checked in by piv, 17 years ago
|
updated version to 0.0.2
|
File size:
1.0 KB
|
Line | |
---|
1 | from Products.CMFCore.utils import getToolByName |
---|
2 | from quintagroup.pingtool.config import SITES_LIST, PROJECTNAME |
---|
3 | |
---|
4 | def setupVarious(context): |
---|
5 | |
---|
6 | # Ordinarily, GenericSetup handlers check for the existence of XML files. |
---|
7 | # Here, we are not parsing an XML file, but we use this text file as a |
---|
8 | # flag to check that we actually meant for this import step to be run. |
---|
9 | # The file is found in profiles/default. |
---|
10 | |
---|
11 | if context.readDataFile('%s_various.txt' % PROJECTNAME) is None: |
---|
12 | return |
---|
13 | |
---|
14 | # Add additional setup code here |
---|
15 | portal = context.getSite() |
---|
16 | existent_sites = portal.portal_pingtool.objectIds() |
---|
17 | for site in SITES_LIST: |
---|
18 | if not site[0] in existent_sites: |
---|
19 | portal.portal_pingtool.invokeFactory(id = site[0], type_name = "PingInfo", title = site[1], url = site[2]) |
---|
20 | |
---|
21 | def removeConfiglet(self): |
---|
22 | if self.readDataFile('%s-uninstall.txt' % PROJECTNAME) is None: |
---|
23 | return |
---|
24 | portal_conf=getToolByName(self.getSite(),'portal_controlpanel') |
---|
25 | portal_conf.unregisterConfiglet('portal_pingtool') |
---|
Note: See
TracBrowser
for help on using the repository browser.