Last change
on this file since 3270 was
3270,
checked in by vmaksymiv, 13 years ago
|
compatibility with plone.app.discussion added
|
File size:
1.1 KB
|
Rev | Line | |
---|
[963] | 1 | import transaction |
---|
| 2 | from Products.CMFCore.utils import getToolByName |
---|
[2041] | 3 | REQUIRED = 'quintagroup.captcha.core' |
---|
[3270] | 4 | from quintagroup.plonecaptchas.config import HAS_APP_DISCUSSION |
---|
| 5 | from quintagroup.plonecaptchas.setuphandlers import registerDiscussionLayer |
---|
[963] | 6 | |
---|
[3160] | 7 | |
---|
[2041] | 8 | def install(self): |
---|
| 9 | qi = getToolByName(self, 'portal_quickinstaller') |
---|
| 10 | # install required quintagroup.captcha.core product |
---|
| 11 | # BBB: Need to success installation in Plone<3.1 |
---|
| 12 | # (with GenericSetup < v1.4.2, where dependency |
---|
| 13 | # support was not yet implemented) |
---|
| 14 | if not REQUIRED in qi.listInstalledProducts(): |
---|
| 15 | qi.installProduct(REQUIRED) |
---|
| 16 | # install plonecaptchas |
---|
| 17 | gs = getToolByName(self, 'portal_setup') |
---|
[3160] | 18 | profile = 'profile-quintagroup.plonecaptchas:default' |
---|
| 19 | gs.runAllImportStepsFromProfile(profile) |
---|
[3270] | 20 | if HAS_APP_DISCUSSION: |
---|
| 21 | # register browser layer |
---|
| 22 | registerDiscussionLayer(self) |
---|
[2041] | 23 | transaction.savepoint() |
---|
| 24 | |
---|
[3160] | 25 | |
---|
[963] | 26 | def uninstall(self): |
---|
| 27 | portal_setup = getToolByName(self, 'portal_setup') |
---|
[3160] | 28 | profile = 'profile-quintagroup.plonecaptchas:uninstall' |
---|
| 29 | portal_setup.runAllImportStepsFromProfile(profile, purge_old=False) |
---|
[963] | 30 | transaction.savepoint() |
---|
Note: See
TracBrowser
for help on using the repository browser.