MCPcopy Create free account
hub / github.com/ImageEngine/cortex / removeMatching

Method removeMatching

python/IECore/MenuDefinition.py:118–131  ·  view source on GitHub ↗
( self, regEx )

Source from the content-addressed store, hash-verified

116 ## Removes all items whose paths match the given
117 # regular expression.
118 def removeMatching( self, regEx ) :
119
120 if type( regEx ) is str :
121 regEx = re.compile( regEx )
122
123 toRemove = []
124 for i in range( 0, len( self.__items ) ) :
125 if regEx.search( self.__items[i][0] ) :
126 toRemove.append( i )
127
128 toRemove.sort()
129 toRemove.reverse()
130 for i in toRemove :
131 del self.__items[i]
132
133 ## Appends another MenuDefinition or dict to the end
134 # of the definition. Duplicate entries will be overwritten.

Callers 1

testMethod · 0.95

Calls 5

typeFunction · 0.85
compileMethod · 0.80
appendMethod · 0.80
sortMethod · 0.80
lenFunction · 0.50

Tested by

no test coverage detected