Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(209)  |  Call(123)  |  Derive(0)  |  Import(86)
Allow a module and all its contents to be used from a
restricted Script. The argument module_name may be a simple
or dotted module or package name. Note that if a package
path is given, all modules in the path will be available.

        def allow_module(module_name):
    """Allow a module and all its contents to be used from a
    restricted Script. The argument module_name may be a simple
    or dotted module or package name. Note that if a package
    path is given, all modules in the path will be available."""
    ModuleSecurityInfo(module_name).setDefaultAccess(1)
    dot = module_name.find('.')
    while dot > 0:
        ModuleSecurityInfo(module_name[:dot]).setDefaultAccess(1)
        dot = module_name.find('.', dot + 1)
        


src/t/e/tecnoteca.googlemap-1.2/tecnoteca/googlemap/__init__.py   tecnoteca.googlemap(Download)
    """
 
    from AccessControl import allow_module, allow_class
    allow_module('tecnoteca.googlemap.content')
 

src/e/r/erp5-HEAD/product/MailTemplates/__init__.py   erp5(Download)
# See license.txt for more details.
 
from AccessControl import allow_module,allow_class
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from MailTemplate import MailTemplate
for name in email.__all__:
    path = 'email.'+name
    allow_module(path)
    try:
        mod = __import__(path)

src/p/r/Products.PloneOntology-1.0.0/Products/PloneOntology/__init__.py   Products.PloneOntology(Download)
from AccessControl import allow_module
from AccessControl import ModuleSecurityInfo
from Products.CMFCore.permissions import AddPortalContent
from Products.CMFCore.DirectoryView import registerDirectory
from Products.CMFCore import utils as cmfutils
 
ModuleSecurityInfo("zExceptions").declarePublic("NotFound")
allow_module("Products.PloneOntology.utils")
allow_module("re")
 

src/q/u/quintagroup.captcha.core-0.4.3/quintagroup/captcha/core/__init__.py   quintagroup.captcha.core(Download)
from zope.i18nmessageid import MessageFactory
 
from AccessControl import allow_module, ModuleSecurityInfo
from Products.CMFCore.utils import ToolInit
 
ModuleSecurityInfo(product).declarePublic("ProductMessageFactory")
 
allow_module('quintagroup.captcha.core.utils')
allow_module('quintagroup.captcha.core.config')
 

src/e/n/enpraxis.educommons-4.1.2/enpraxis/educommons/__init__.py   enpraxis.educommons(Download)
from Products.Archetypes.atapi import process_types, listTypes
from Products.CMFCore.DirectoryView import registerDirectory
from AccessControl import allow_module, allow_class
from collective.captcha.browser.captcha import Captcha
from zope.i18nmessageid import MessageFactory
from enpraxis.educommons.loadtesttool import LoadTestTool
 
allow_module('collective.captcha.browser.captcha')

src/p/r/Products.Formulator-1.15.5/Products/Formulator/monkey.py   Products.Formulator(Download)
# -*- coding: utf-8 -*-
# Copyright (c) 2013  Infrae. All rights reserved.
# See also LICENSE.txt
from AccessControl import allow_class, allow_module
 
        # allow_class(Message)
        # instead we have to allow the module ...
        allow_module('zope.i18nmessageid.message')
 
def patch_all():

src/e/a/Easyshop-HEAD/src/easyshop.core/easyshop/core/__init__.py   Easyshop(Download)
def initialize(context):
    """Initializer called when used as a Zope 2 product."""
    from AccessControl import allow_module
    allow_module('zope.component')
    allow_module('zope.event')
    allow_module("pdb")    

src/e/a/Easyshop-HEAD/Attic_from_svn_import/iqpp.easyshop/iqpp/easyshop/__init__.py   Easyshop(Download)
def initialize(context):
    """Initializer called when used as a Zope 2 product."""
    from AccessControl import allow_module
    allow_module('zope.component')
    allow_module('zope.event')
    allow_module("pdb")    

src/p/r/Products.DataGridField-1.9.0/Products/DataGridField/utils.py   Products.DataGridField(Download)
__docformat__ = 'restructuredtext'
 
from AccessControl import ModuleSecurityInfo, allow_module
from Products.CMFCore.utils import getToolByName
 
 
module = "Products.DataGridField.utils"
security = ModuleSecurityInfo(module)
allow_module(module)

src/b/e/betahaus.emaillogin-0.6.1/betahaus/emaillogin/__init__.py   betahaus.emaillogin(Download)
def initialize(context):
    from AccessControl import allow_module, allow_class
 
    allow_module('betahaus.emaillogin')
    allow_class(EmailMessageFactory)

Previous  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next