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/s/i/silva.captcha-1.3.1/src/silva/captcha/__init__.py   silva.captcha(Download)
 
from zope.component import getMultiAdapter
from AccessControl import ModuleSecurityInfo, allow_module
from Products.Formulator.FieldRegistry import FieldRegistry
 
FieldRegistry.registerField(formulator.CaptchaField) # XXX fix icon
 
allow_module('silva.captcha')
module_security = ModuleSecurityInfo('silva.captcha')
module_security.declareProtected('View', 'validate')

src/m/e/MegamanicEdit-2.0.15b/MegamanicEdit/MegamanicEdit/__init__.py   MegamanicEdit(Download)
    pass
 
from AccessControl import allow_class, allow_module
allow_module('MegamanicEdit.MegamanicEdit.FakeRequest')
 

src/p/r/Products.slideshowfolder-4.1b1/Products/slideshowfolder/__init__.py   Products.slideshowfolder(Download)
 
# Allow access from restricted python to some modules.
from AccessControl import allow_module, allow_class
allow_module('Products.slideshowfolder.interfaces')
from Products.slideshowfolder.slideshowsetting import SlideShowSettings

src/p/l/plone.sequencebatch-1.0a1/plone/sequencebatch/__init__.py   plone.sequencebatch(Download)
from plone.sequencebatch.batch import Batch
 
from AccessControl import allow_class
from AccessControl import allow_module
 
allow_module('plone.sequencebatch')

src/p/r/Products.AccessibleReferenceBrowserWidget-1.0a/Products/AccessibleReferenceBrowserWidget/allow.py   Products.AccessibleReferenceBrowserWidget(Download)
from AccessControl import allow_class, allow_module
from implements_arbw import implements_arbw
allow_module('Products.AccessibleReferenceBrowserWidget.implements_arbw')
allow_class(implements_arbw)
 

src/p/r/Products.AdvancedQuery-3.0.3/Products/AdvancedQuery/__init__.py   Products.AdvancedQuery(Download)
'''
 
from AccessControl import allow_module as _allow_module, ClassSecurityInfo
 
try: from AccessControl.class_init import InitializeClass
############################################################################
## Security
_allow_module('Products.AdvancedQuery')
_s = ClassSecurityInfo(); _s.declarePublic('addSubquery')
_CompositeQuery._s = _s; InitializeClass(_CompositeQuery)

src/p/l/plone.batching-1.0.2/plone/batching/__init__.py   plone.batching(Download)
from plone.batching.batch import Batch
 
from AccessControl import allow_class
from AccessControl import allow_module
 
allow_module('plone.batching')

src/c/o/collective.captchaforms-0.1-20090814/collective/captchaforms/__init__.py   collective.captchaforms(Download)
from AccessControl import allow_module, allow_class
from collective.captcha.browser.captcha import Captcha
 
def initialize(context):
	"""Initializer called when used as a Zope 2 product."""
 
	allow_module('collective.captcha.browser.captcha')

src/e/a/Easyshop-HEAD/Attic_from_svn_import/EasyShop/__init__.py   Easyshop(Download)
def initialize(context):
    from AccessControl import allow_module
    allow_module('zope.component')
    allow_module("pdb")    
 

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

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