本文整理汇总了Python中lettuce.registry.CALLBACK_REGISTRY.append_to方法的典型用法代码示例。如果您正苦于以下问题:Python CALLBACK_REGISTRY.append_to方法的具体用法?Python CALLBACK_REGISTRY.append_to怎么用?Python CALLBACK_REGISTRY.append_to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lettuce.registry.CALLBACK_REGISTRY
的用法示例。
在下文中一共展示了CALLBACK_REGISTRY.append_to方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: inner
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def inner(self, callback, name=None):
if not callable(callback):
name = callback
return lambda callback: inner(self, callback, name=name)
CALLBACK_REGISTRY.append_to(
where,
when.format(name=self.name),
function=callback,
name=name,
)
return callback
示例2: each_feature
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def each_feature(cls, function):
CALLBACK_REGISTRY.append_to('feature', "%s_each" % cls.__name__, function)
return function
示例3: outline
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def outline(cls, function):
CALLBACK_REGISTRY.append_to('scenario', "outline", function)
return function
示例4: each_scenario
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def each_scenario(cls, function):
CALLBACK_REGISTRY.append_to('scenario', "%s_each" % cls.__name__, function)
return function
示例5: each_step
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def each_step(cls, function):
CALLBACK_REGISTRY.append_to('step', "%s_each" % cls.__name__, function)
return function
示例6: all
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def all(cls, function):
CALLBACK_REGISTRY.append_to('all', cls.__name__, function)
return function
示例7: method
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def method(self, fn):
CALLBACK_REGISTRY.append_to(where, when % {'0': self.name}, fn)
return fn
示例8: handle_request
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def handle_request(cls, function):
CALLBACK_REGISTRY.append_to('handle_request', cls.__name__, function)
return function
示例9: runserver
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def runserver(cls, function):
CALLBACK_REGISTRY.append_to('runserver', cls.__name__, function)
return function
示例10: method
# 需要导入模块: from lettuce.registry import CALLBACK_REGISTRY [as 别名]
# 或者: from lettuce.registry.CALLBACK_REGISTRY import append_to [as 别名]
def method(self, fn):
CALLBACK_REGISTRY.append_to(where, when.format(self.name), fn)
return fn