File: SetupBase.py

package info (click to toggle)
zope-cmfplone 2.5.1-4etch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 7,752 kB
  • ctags: 5,237
  • sloc: python: 28,264; xml: 3,723; php: 129; makefile: 99; sh: 2
file content (53 lines) | stat: -rw-r--r-- 1,792 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from Products.CMFPlone.utils import log_deprecated

class SetupWidget:
    # if single is set to one, then we will
    # show radio buttons rather than check boxes
    single = 0

    def __init__(self, portal):
        self.portal = portal
        log_deprecated("SetupWidget is deprecated and will be removed in Plone"
                       " 3.0. Site creation is based on GenericSetup now.")


    #####################################################
    # To be overridden

    def addItems(self, items):
        """ Adds the items into our Plone database
        Items - a list of things that means something
        to this widget, for example the languages widget
        takes the abbreviations of the pot files
        """
        raise NotImplementedError

    def delItems(self, items):
        """ Dels the items out of our Plone database
        Items - a list of things that means something
        to this widget, for example the languages widget
        takes the abbreviations of the pot files
        """
        raise NotImplementedError

    def active(self):
        """ Returns 1 if this setup widget can be run,
        if the user doesn't have the correct products, for
        example, then a string of the reason why is returned
        """

        # by default this is 1
        return 1

    def setup(self):
        """ Anything that has to be done for this setup widget
        to work, this could be adding in new objects or such. """

        # by default this is working out of the box, ha!
        pass

    def installed(self):
        """ Returns a list of the installed items, so that user
        knows what is currently installed. These items are what
        we would pass to the addItems and delItems methods """
        raise NotImplementedError