當前位置: 首頁>>代碼示例>>Python>>正文


Python ModuleSecurityInfo.apply方法代碼示例

本文整理匯總了Python中AccessControl.SecurityInfo.ModuleSecurityInfo.apply方法的典型用法代碼示例。如果您正苦於以下問題:Python ModuleSecurityInfo.apply方法的具體用法?Python ModuleSecurityInfo.apply怎麽用?Python ModuleSecurityInfo.apply使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AccessControl.SecurityInfo.ModuleSecurityInfo的用法示例。


在下文中一共展示了ModuleSecurityInfo.apply方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from AccessControl.SecurityInfo import ModuleSecurityInfo [as 別名]
# 或者: from AccessControl.SecurityInfo.ModuleSecurityInfo import apply [as 別名]
    _guarded_writes = 1

    def __init__(self, **kw):
        self.update(kw)

    def __setitem__(self, key, value):
        key = str(key)
        if key.startswith('_'):
            raise ValueError, ('Object key %s is invalid. '
                               'Keys may not begin with an underscore.' % `key`)
        self.__dict__[key] = value

    def update(self, d):
        for key in d.keys():
            # Ignore invalid keys, rather than raising an exception.
            try:
                skey = str(key)
            except:
                continue
            if skey==key and not skey.startswith('_'):
                self.__dict__[skey] = d[key]

    def __hash__(self):
        return id(self)

security.declarePublic('Object')
def Object(**kw):
    return _Object(**kw)

security.apply(globals())
開發者ID:c0ns0le,項目名稱:zenoss-4,代碼行數:32,代碼來源:standard.py

示例2: __str__

# 需要導入模塊: from AccessControl.SecurityInfo import ModuleSecurityInfo [as 別名]
# 或者: from AccessControl.SecurityInfo.ModuleSecurityInfo import apply [as 別名]
    def __str__(self):
        ''' Stringfy .. return the source
        '''
        return self.quotedHTML(self.source)

    __call__ = __str__

    def PrincipiaSearchSource(self):
        ''' Support for searching - the document's contents are searched.
        '''
        return self.source

    def manage_historyCompare(self, rev1, rev2, REQUEST,
                              historyComparisonResults=''):
        return ZReST.inheritedAttribute('manage_historyCompare')(
            self, rev1, rev2, REQUEST,
            historyComparisonResults=html_diff(rev1.source, rev2.source))

    def manage_editProperties(self, REQUEST):
        """ re-render the page after changing the properties (encodings!!!) """
        result = PropertyManager.manage_editProperties(self, REQUEST)        
        self._clear_cache()
        return result


InitializeClass(ZReST)
modulesecurity.apply(globals())


# vim: set filetype=python ts=4 sw=4 et si
開發者ID:Andyvs,項目名稱:TrackMonthlyExpenses,代碼行數:32,代碼來源:ZReST.py


注:本文中的AccessControl.SecurityInfo.ModuleSecurityInfo.apply方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。