本文整理汇总了Python中conductor.native.lib.sequence.Sequence.is_valid_spec方法的典型用法代码示例。如果您正苦于以下问题:Python Sequence.is_valid_spec方法的具体用法?Python Sequence.is_valid_spec怎么用?Python Sequence.is_valid_spec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conductor.native.lib.sequence.Sequence
的用法示例。
在下文中一共展示了Sequence.is_valid_spec方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: validate_scout_range
# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import is_valid_spec [as 别名]
def validate_scout_range(node, **_):
"""Set valid tickmark for scout range spec.
TODO Currently we only validate that the spec produces
valid frames. We should also validate that at least one
scout frame exist in the main frame range.
"""
takes.enable_for_current(node, "scout_valid")
spec = node.parm("scout_frames").eval()
valid = Sequence.is_valid_spec(spec)
node.parm("scout_valid").set(valid)
update_frame_stats_message(node)
示例2: validate_custom_range
# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import is_valid_spec [as 别名]
def validate_custom_range(node, **_):
"""Set valid tickmark for custom range spec.
A custom range is valid when it is a comma separated
list of arithmetic progressions. These can can be
formatted as single numbers or ranges with a hyphen and
optionally a step value delimited by an x. Example,
1,7,10-20,30-60x3,1001, Spaces and trailing commas are
allowed, but not letters or other non numeric
characters.
"""
takes.enable_for_current(node, "custom_valid")
spec = node.parm("custom_range").eval()
valid = Sequence.is_valid_spec(spec)
node.parm("custom_valid").set(valid)
update_frame_stats_message(node)
uistate.update_button_state(node)
示例3: test_is_valid_method_false
# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import is_valid_spec [as 别名]
def test_is_valid_method_false(self):
self.assertFalse(Sequence.is_valid_spec("12-26x3d, 1,7,8,2,4-9"))
self.assertFalse(Sequence.is_valid_spec(",4x9,2,"))
self.assertFalse(Sequence.is_valid_spec(" "))
示例4: test_is_valid_method_bad_type
# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import is_valid_spec [as 别名]
def test_is_valid_method_bad_type(self):
with self.assertRaises(TypeError):
Sequence.is_valid_spec(1)
with self.assertRaises(TypeError):
Sequence.is_valid_spec(None)
示例5: test_is_valid_method_true
# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import is_valid_spec [as 别名]
def test_is_valid_method_true(self):
self.assertTrue(Sequence.is_valid_spec("12-26x3, 1,7,8,2,4-9"))
self.assertTrue(Sequence.is_valid_spec("1"))
self.assertTrue(Sequence.is_valid_spec(",4-9,2,"))