本文整理汇总了Python中zope.deprecation.__show__.on函数的典型用法代码示例。如果您正苦于以下问题:Python on函数的具体用法?Python on怎么用?Python on使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了on函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
def tearDown(self):
from zope.deprecation import __show__
__show__.on()
testing.tearDown()
import sys
import shutil
if self.module is not None:
del sys.modules[self.module.__name__]
if self.tempdir is not None:
sys.path.pop(0)
shutil.rmtree(self.tempdir)
示例2: test_backward_compat_delegates_to_mixin
def test_backward_compat_delegates_to_mixin(self):
request = _makeFakeRequest()
from zope.deprecation import __show__
try:
__show__.off()
from pyramid.security import effective_principals
self.assertEqual(
effective_principals(request),
'effective_principals'
)
finally:
__show__.on()
示例3: test_delegates_to_mixin
def test_delegates_to_mixin(self):
from zope.deprecation import __show__
try:
__show__.off()
mixin = self._makeOne()
from pyramid.security import has_permission
self.called_has_permission = False
def mocked_has_permission(*args, **kw):
self.called_has_permission = True
mixin.has_permission = mocked_has_permission
has_permission('view', object(), mixin)
self.assertTrue(self.called_has_permission)
finally:
__show__.on()
示例4: tearDown
def tearDown(self):
testing.tearDown()
from zope.deprecation import __show__
__show__.on()
示例5: tearDown
def tearDown(self):
self.config.end()
from zope.deprecation import __show__
__show__.on()
示例6: tearDown
def tearDown(self):
super(TestUnencryptedCookieSession, self).tearDown()
from zope.deprecation import __show__
__show__.on()
示例7: tearDown
def tearDown(self):
from zope.deprecation import __show__
__show__.on()
示例8: tearDown
def tearDown(self):
from pyramid.threadlocal import manager
manager.clear()
from zope.deprecation import __show__
__show__.on()
示例9: Attribute
debug = Attribute('The ``debug_templates`` setting for this application')
auto_reload = Attribute('The ``reload_templates`` setting for this app')
def __call__(self, info):
""" Return an ITemplateRenderer based on IRendererInfo ``info`` """
class IChameleonTranslate(Interface):
""" Internal interface representing a chameleon translate function """
def __call__(msgid, domain=None, mapping=None, context=None,
target_language=None, default=None):
""" Translate a mess of arguments to a Unicode object """
from zope.deprecation import __show__
__show__.off()
try:
# For backwards compatibility, as long as ITemplateRenderer
# exists, we will still implement that.
from pyramid.interfaces import ITemplateRenderer
class IChameleonTemplateRenderer(ITemplateRenderer):
"Chameleon-specific template renderer"
except ImportError:
from pyramid.interfaces import IRenderer
class IChameleonTemplateRenderer(IRenderer):
"Chameleon-specific template renderer"
def implementation():
""" Return the object that the underlying templating system
uses to render the template; it is typically a callable that
accepts arbitrary keyword arguments and returns a string or
unicode object """
finally:
__show__.on()