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/c/y/cyn.in-HEAD/src/ubify.viewlets/ubify/viewlets/__init__.py   cyn.in(Download)
#Mumbai-400064, India
###############################################################################
from AccessControl import allow_module
from AccessControl import ModuleSecurityInfo
 

src/c/y/cyn.in-HEAD/src/ubify.viewlets/ubify/viewlets/utils.py   cyn.in(Download)
from Products.PageTemplates.GlobalTranslationService import \
     getGlobalTranslationService
from AccessControl import allow_module
from AccessControl import ModuleSecurityInfo
 

src/c/y/cyn.in-HEAD/src/ubify.smartview/ubify/smartview/__init__.py   cyn.in(Download)
from zope.i18nmessageid import MessageFactory
from Products.CMFCore.permissions import setDefaultRoles
from AccessControl import allow_module
from AccessControl import ModuleSecurityInfo
from Products.AdvancedQuery import Eq, Between, Le

src/b/i/Bika-LIMS-HEAD/bika/lims/idserver.py   Bika-LIMS(Download)
from AccessControl import ModuleSecurityInfo, allow_module
from DateTime import DateTime
from Products.Archetypes.public import DisplayList
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.TranslationServiceTool import TranslationServiceTool

src/p/r/Products.PythonScripts-2.13.2/src/Products/PythonScripts/Utility.py   Products.PythonScripts(Download)
# These have been relocated, and should be imported from AccessControl
 
from AccessControl import allow_module, allow_class
 

src/p/r/Products.CalendarX-1.0.4/Products/CalendarX/__init__.py   Products.CalendarX(Download)
except ImportError:
    from Globals import package_home
from AccessControl import allow_module
from AccessControl import ModuleSecurityInfo
from Products.Archetypes import listTypes

src/c/o/collective.local.sendto-1.6/collective/local/sendto/__init__.py   collective.local.sendto(Download)
# -*- extra stuff goes here -*-
import logging
log = logging.getLogger('collective.local.sendto')
 
from AccessControl import allow_module

src/k/s/kss.core-1.6.5/kss/core/tests/test_ttwapi.py   kss.core(Download)
ZopeTestCase.installProduct('PythonScripts')
 
from AccessControl import allow_module
allow_module('kss.core.tests.help_ttwapi')
 

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