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/Zope-HEAD/src/OFS/misc_.py   Zope(Download)
from os.path import dirname
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
import App
    security.declareObjectPublic()
 
InitializeClass(misc_)
 
 
    zopelogo_png = ImageFile('www/zopelogo.png', app_dir)
 
InitializeClass(p_)
 
 
    def __setitem__(self, name, v): self._d[name]=v
 
InitializeClass(Misc_)
 

src/z/o/Zope2-2.13.22/src/OFS/PropertySheets.py   Zope2(Download)
import sys
 
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import access_contents_information
from AccessControl.Permissions import manage_properties
            return self.manage(self, REQUEST)
 
InitializeClass(PropertySheet)
 
 
    _md={'xmlns': 'http://www.zope.org/propsets/default'}
 
InitializeClass(DefaultProperties)
 
 
        return out
 
InitializeClass(DAVProperties)
 
 
            self, script, path)
 
InitializeClass(PropertySheets)
 
 

src/z/o/Zope-HEAD/src/OFS/PropertySheets.py   Zope(Download)
import sys
 
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import access_contents_information
from AccessControl.Permissions import manage_properties
            return self.manage(self, REQUEST)
 
InitializeClass(PropertySheet)
 
 
    _md={'xmlns': 'http://www.zope.org/propsets/default'}
 
InitializeClass(DefaultProperties)
 
 
        return out
 
InitializeClass(DAVProperties)
 
 
            self, script, path)
 
InitializeClass(PropertySheets)
 
 

src/z/o/Zope2-2.13.22/src/OFS/misc_.py   Zope2(Download)
from os.path import dirname
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
import App
    security.declareObjectPublic()
 
InitializeClass(misc_)
 
 
    HelpTopic_icon=ImageFile('images/helpTopic.gif', helpsys_dir)
 
InitializeClass(p_)
 
 
    def __setitem__(self, name, v): self._d[name]=v
 
InitializeClass(Misc_)
 

src/z/o/Zope2-2.13.22/src/HelpSys/APIHelpTopic.py   Zope2(Download)
import types
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from App.special_dtml import DTMLFile
    view=DTMLFile('dtml/APIView', globals())
 
InitializeClass(APIDoc)
 
 
    view=DTMLFile('dtml/attributeView', globals())
 
InitializeClass(AttributeDoc)
 
 
    view=DTMLFile('dtml/methodView', globals())
 
InitializeClass(MethodDoc)
 
 

src/p/r/Products.BastionLedger-4.6.0/Products/BastionLedger/FSBLProcess.py   Products.BastionLedger(Download)
        BLTransactionTemplate.__init__(self, self.id, self.id)
 
AccessControl.class_init.InitializeClass( FSBLTransactionTemplateViewSurrogate )
 
class FSBLTransactionTemplateView( DirectoryView ):
 
 
AccessControl.class_init.InitializeClass(FSBLTransactionTemplateView)
 
 
        return obj
 
AccessControl.class_init.InitializeClass(FSBLEntryTemplate)
 
class FSBLTransactionTemplate(FSPythonScript):
        return obj
 
AccessControl.class_init.InitializeClass(FSBLTransactionTemplate)
 
 

src/z/o/Zope2-2.13.22/src/OFS/ZDOM.py   Zope2(Download)
All standard Zope objects support DOM to a limited extent.
"""
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.Permissions import access_contents_information
        return len(self.objectIds())
 
InitializeClass(Node)
 
 
        return 1
 
InitializeClass(Document)
 
 
            return 0
 
InitializeClass(DOMImplementation)
 
 
        return NodeList(nodeList)
 
InitializeClass(Element)
 
 

src/z/o/Zope2-2.13.22/src/OFS/Application.py   Zope2(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)
 
    def PrincipiaRedirect(self, destination, URL1):
        """Utility function to allow user-controlled redirects"""
        return reg.get(flag)
 
InitializeClass(Application)
 
 
 
    Products.meta_types=Products.meta_types+tuple(meta_types)
    InitializeClass(Folder.Folder)
 
def get_products():
 
    Products.meta_types=Products.meta_types+tuple(meta_types)
    InitializeClass(Folder.Folder)
 
 

src/p/r/Products.BastionLedger-4.6.0/Products/BastionLedger/BLShareholderLedger.py   Products.BastionLedger(Download)
        return 0
 
AccessControl.class_init.InitializeClass(BLShareDefinition)
 
 
            self.definition = self.getId()
 
AccessControl.class_init.InitializeClass( BLAllocation )
 
def manage_addBLCall(self, allocation_id, percentage, call_date, required_date, REQUEST=None):
 
 
AccessControl.class_init.InitializeClass(BLCall)
 
 
        BLSubsidiaryAccount._repair(self)
 
AccessControl.class_init.InitializeClass( BLShareholder )
 
manage_addBLShareholderLedgerForm = PageTemplateFile('zpt/add_shareholderledger', globals())
        return votes
 
AccessControl.class_init.InitializeClass( BLShareholderLedger )
 
 

src/p/r/Products.BastionLedger-4.6.0/Products/BastionLedger/BLOrderBook.py   Products.BastionLedger(Download)
            self.inventory = self.aq_parent.objectIds('BLInventory')[0]
 
AccessControl.class_init.InitializeClass(BLOrderBook)
 
 
            del self.__dict__['__allow_groups__']
 
AccessControl.class_init.InitializeClass(BLOrderAccount)
 
manage_addBLOrderItemForm = PageTemplateFile('zpt/add_orderitem', globals()) 
                    self.amount = ZCurrency(self.aq_parent.aq_parent.base_currency, 0)
 
AccessControl.class_init.InitializeClass(BLOrderItem)
 
manage_addBLOrderForm = PageTemplateFile('zpt/add_order', globals())                                         
 
 
AccessControl.class_init.InitializeClass(BLOrder)
 
def addBLCashBook(self, id, title='',REQUEST=None):
        return self._getOb(id)
 
AccessControl.class_init.InitializeClass(BLCashAccount)
 
class BLCashOrder(BLOrder):

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