source: publico/ILSAALMaterial/trunk/Extensions/InstallPublic.py @ 1523

Última Alteração nesse arquivo desde 1523 foi 1265, incluída por brunopinheiro, 14 anos atrás

Modificado script de instalação de módulos externos.

File size: 1.0 KB
Linha 
1from StringIO import StringIO
2from Products.CMFCore.DirectoryView import addDirectoryViews, registerDirectory
3from Products.CMFCore.utils import getToolByName
4
5from Products.ILSAALMaterial.config import PROJECTNAME
6from Products.ILSAALMaterial.config import product_globals
7
8from Products.Archetypes.Extensions.utils import installTypes
9#from Products.Archetypes.Extensions.utils import install_subskin
10try:
11    from Products.Archetypes.lib.register import listTypes
12except ImportError:
13    from Products.Archetypes.public import listTypes
14from Products.Archetypes import types_globals
15
16
17
18
19def install_public(self, externals):
20
21    out = StringIO()
22
23    classes_material = listTypes(PROJECTNAME)
24    values = [v for v in classes_material if v['name'] in externals]
25    installTypes(self, out,
26                 values,
27                 PROJECTNAME)
28
29    product_skins_dir = 'skins'
30
31    skinstool = getToolByName(self, 'portal_skins')
32    registerDirectory(product_skins_dir, product_globals)
33    addDirectoryViews(skinstool, product_skins_dir, product_globals)
34
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.