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

All Samples(476)  |  Call(297)  |  Derive(0)  |  Import(179)

        def InitializeClass(self):
    from AccessControl.Permission import registerPermissions
    from AccessControl.PermissionRole import PermissionRole
    dict=self.__dict__
    have=dict.has_key
    ft=type(InitializeClass)
    dict_items=dict.items()

    for name, v in dict_items:
        if getattr(v, '_need__name__', 0):
            d = v.__dict__
            oldname = d.get('__name__', '')
            if d.get('_implicit__name__', 0):
                # Already supplied a name.
                if name != oldname:
                    # Tried to implicitly assign a different name!
                    try: classname = '%s.%s' % (
                        self.__module__, self.__name__)
                    except AttributeError: classname = `self`
                    logging.getLogger("Init").warning(
                        'Ambiguous name for method of %s: %r != %r',
                        classname, d['__name__'], name)
            else:
                # Supply a name implicitly so that the method can
                # find the security assertions on its container.
                v._implicit__name__ = 1
                v.__name__ = name
            if name=='manage' or name[:7]=='manage_':
                name=name+'__roles__'
                if not have(name):
                    setattr(self, name, ('Manager',))
        elif name=='manage' or name[:7]=='manage_' and type(v) is ft:
            name=name+'__roles__'
            if not have(name):
                setattr(self, name, ('Manager',))

    # Look for a SecurityInfo object on the class. If found, call its
    # apply() method to generate __ac_permissions__ for the class. We
    # delete the SecurityInfo from the class dict after it has been
    # applied out of paranoia.
    for key, value in dict_items:
        if hasattr(value, '__security_info__'):
            security_info=value
            security_info.apply(self)
            delattr(self, key)
            break

    if self.__dict__.has_key('__ac_permissions__'):
        registerPermissions(self.__ac_permissions__)
        for acp in self.__ac_permissions__:
            pname, mnames = acp[:2]
            if len(acp) > 2:
                roles = acp[2]
                pr = PermissionRole(pname, roles)
            else:
                pr = PermissionRole(pname)
            for mname in mnames:
                setattr(self, mname+'__roles__', pr)
                if (mname and mname not in ('context', 'request') and
                    not hasattr(self, mname)):
                    # don't complain about context or request, as they are
                    # frequently not available as class attributes
                    logging.getLogger("Init").warning(
                        "Class %s.%s has a security declaration for "
                        "nonexistent method %r", self.__module__,
                        self.__name__, mname)
        


src/z/o/Zope2-2.13.22/src/OFS/SimpleItem.py   Zope2(Download)
import time
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
        return res
 
InitializeClass(Item)
 
 
        )
 
InitializeClass(SimpleItem)
 

src/z/o/Zope2-2.13.22/src/OFS/Image.py   Zope2(Download)
import struct
 
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import change_images_and_files
from AccessControl.Permissions import view_management_screens
        return ''
 
InitializeClass(File)
 
 
        return '%s />' % result
 
InitializeClass(Image)
 
 

src/z/o/Zope2-2.13.22/src/OFS/CopySupport.py   Zope2(Download)
from AccessControl import ClassSecurityInfo
from AccessControl import getSecurityManager
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import view_management_screens
from AccessControl.Permissions import copy_or_move
                action = 'manage_main'))
 
InitializeClass(CopyContainer)
 
 
            return 1
 
InitializeClass(CopySource)
 
 

src/z/o/Zope2-2.13.22/src/OFS/Cache.py   Zope2(Download)
import time
 
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import view_management_screens
from AccessControl.SecurityInfo import ClassSecurityInfo
 
 
InitializeClass(Cacheable)
 
 
                )
 
InitializeClass(CacheManager)
 

src/z/o/Zope2-2.13.22/src/HelpSys/ObjectRef.py   Zope2(Download)
from urllib import quote
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from App.special_dtml import DTMLFile
        return []
 
InitializeClass(ObjectItem)
 
 
        return self.__dict__[key].__of__(self)
 
InitializeClass(ObjectRef)
 

src/z/o/Zope2-2.13.22/src/HelpSys/HelpSys.py   Zope2(Download)
from cgi import escape
 
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import access_contents_information
from AccessControl.Permissions import add_documents_images_and_files
        return cols
 
InitializeClass(HelpSys)
 
 
    standard_html_footer=DTMLFile('dtml/topic_footer', globals())
 
InitializeClass(ProductHelp)
 

src/z/o/Zope2-2.13.22/src/App/Product.py   Zope2(Download)
import os
 
from AccessControl.class_init import InitializeClass
from AccessControl.owner import UnownableOwner
from AccessControl.SecurityInfo import ClassSecurityInfo
        return 0
 
InitializeClass(ProductFolder)
 
 
            return self.manage_refresh(REQUEST)
 
InitializeClass(Product)
 
 

src/z/o/Zope2-2.13.22/src/App/Management.py   Zope2(Download)
from AccessControl import getSecurityManager, Unauthorized
from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import view_management_screens
from App.interfaces import INavigation
        return '/'.join(out)
 
InitializeClass(Tabs)
 
 
setattr(Navigation, 'manage_page_style.css', file)
 
InitializeClass(Navigation)
 

src/z/o/Zope2-2.13.22/src/App/FactoryDispatcher.py   Zope2(Download)
import types
 
from AccessControl.class_init import InitializeClass
from AccessControl.owner import UnownableOwner
from AccessControl.SecurityInfo import ClassSecurityInfo
        return ProductHelp('Help', self.id).__of__(self)
 
InitializeClass(Product)
 
 
        REQUEST['RESPONSE'].redirect(self.DestinationURL()+d)
 
InitializeClass(FactoryDispatcher)
 

src/z/o/Zope-HEAD/src/OFS/Application.py   Zope(Download)
import transaction
from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
from AccessControl.Permission import ApplicationDefaultPermissions
from Acquisition import aq_base
    def __class_init__(self):
        InitializeClass(self)
 
    @property
    def Control_Panel(self):
        return ('', )
 
InitializeClass(Application)
 
 
 
    Products.meta_types = Products.meta_types + tuple(meta_types)
    InitializeClass(Folder.Folder)
 
def get_products():

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