File: __init__.py

package info (click to toggle)
zope-atextensions 0.9.2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 468 kB
  • ctags: 327
  • sloc: python: 1,868; xml: 362; makefile: 31; sh: 5
file content (40 lines) | stat: -rw-r--r-- 1,452 bytes parent folder | download
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
##########################################################################
#                                                                        #
#           copyright (c) 2004 ITB, Humboldt-University Berlin           #
#           written by: Raphael Ritz, r.ritz@biologie.hu-berlin.de       #
#                                                                        #
##########################################################################

"""package installer"""

from Products.CMFCore import utils
from Products.CMFCore.DirectoryView import registerDirectory
from Products.Archetypes.public import process_types, listTypes
from config import *

# the custom validator
from Products.validation import validation
from validator.isPartialUrl import PartialUrlValidator
validation.register(PartialUrlValidator('isPartialUrl'))

# the demo content types
from examples import demo, formattablename

# backwards compatibility
import sys
import ateapi
sys.modules['Products.ATExtensions.at_extensions'] = ateapi

registerDirectory(SKINS_DIR, GLOBALS)

def initialize(context):
    content_types, constructors, ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)
    utils.ContentInit(
        PROJECTNAME + ' Content',
        content_types      = content_types,
        permission         = ADD_CONTENT_PERMISSION,
        extra_constructors = constructors,
        fti                = ftis,
        ).initialize(context)