本文整理汇总了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())
示例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