本文整理汇总了Python中Gaffer.match方法的典型用法代码示例。如果您正苦于以下问题:Python Gaffer.match方法的具体用法?Python Gaffer.match怎么用?Python Gaffer.match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gaffer
的用法示例。
在下文中一共展示了Gaffer.match方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __plugMetadataChanged
# 需要导入模块: import Gaffer [as 别名]
# 或者: from Gaffer import match [as 别名]
def __plugMetadataChanged( self, nodeTypeId, plugPath, key ) :
if self.__key != key :
return
if not self.__target.node().isInstanceOf( nodeTypeId ) :
return
if not Gaffer.match( self.__target.relativeName( self.__target.node() ), plugPath ) :
return
self.__update()
示例2: test
# 需要导入模块: import Gaffer [as 别名]
# 或者: from Gaffer import match [as 别名]
def test( self ) :
for s, p, r in [
( "", "", True ),
( "a", "a", True ),
( "a", "*", True ),
( "ab", "a*", True ),
( "cat", "dog", False ),
( "dogfish", "*fish", True ),
( "dogcollar", "*fish", False ),
] :
self.assertEqual( Gaffer.match( s, p ), r )
示例3: _plugMetadataChanged
# 需要导入模块: import Gaffer [as 别名]
# 或者: from Gaffer import match [as 别名]
def _plugMetadataChanged(cls, nodeTypeId, plugPath, key):
for i in cls.__instances:
instance = i()
if instance is None or instance.getTarget() is None:
continue
if instance.__key != key:
continue
if not isinstance(instance.getTarget(), Gaffer.Plug):
continue
if not instance.getTarget().node().isInstanceOf(nodeTypeId):
continue
if not Gaffer.match(instance.getTarget().relativeName(instance.getTarget().node()), plugPath):
continue
instance.__updateWidgetValue()
示例4: testMatch
# 需要导入模块: import Gaffer [as 别名]
# 或者: from Gaffer import match [as 别名]
def testMatch( self ) :
for s, p, r in [
( "", "", True ),
( "a", "a", True ),
( "a", "*", True ),
( "ab", "a*", True ),
( "cat", "dog", False ),
( "dogfish", "*fish", True ),
( "dogcollar", "*fish", False ),
( "dog collar", "dog collar", True ),
( "dog collar", "dog co*", True ),
( "dog collar", "dog *", True ),
( "dog collar", "dog*", True ),
] :
self.assertEqual( Gaffer.match( s, p ), r )
if " " not in s :
self.assertEqual( Gaffer.matchMultiple( s, p ), r )