本文整理汇总了Python中morepath.tween.TweenRegistry类的典型用法代码示例。如果您正苦于以下问题:Python TweenRegistry类的具体用法?Python TweenRegistry怎么用?Python TweenRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TweenRegistry类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_tween_sorting_one_tween
def test_tween_sorting_one_tween():
reg = TweenRegistry()
def foo():
pass
reg.register_tween_factory(foo, over=None, under=None)
assert reg.sorted_tween_factories() == [foo]
示例2: test_tween_sorting_dag_error2
def test_tween_sorting_dag_error2():
reg = TweenRegistry()
def a():
pass
reg.register_tween_factory(a, over=a, under=None)
with pytest.raises(TopologicalSortError):
reg.sorted_tween_factories()
示例3: test_tween_sorting_two_tweens_over_reverse_reg
def test_tween_sorting_two_tweens_over_reverse_reg():
reg = TweenRegistry()
def top():
pass
def bottom():
pass
reg.register_tween_factory(bottom, over=None, under=None)
reg.register_tween_factory(top, over=bottom, under=None)
assert reg.sorted_tween_factories() == [top, bottom]
示例4: test_tween_sorting_three
def test_tween_sorting_three():
reg = TweenRegistry()
def a():
pass
def b():
pass
def c():
pass
reg.register_tween_factory(a, over=None, under=None)
reg.register_tween_factory(b, over=None, under=a)
reg.register_tween_factory(c, over=a, under=None)
assert reg.sorted_tween_factories() == [c, a, b]
示例5: test_tween_sorting_no_tweens
def test_tween_sorting_no_tweens():
reg = TweenRegistry()
assert reg.sorted_tween_factories() == []