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

Method insertAfter

python/IECore/MenuDefinition.py:90–98  ·  view source on GitHub ↗
( self, path, item, afterPath )

Source from the content-addressed store, hash-verified

88
89 ## Insert a menu item after the specified menu item.
90 def insertAfter( self, path, item, afterPath ) :
91
92 if isinstance( item, dict ) :
93 item = MenuItemDefinition( item )
94
95 self.remove( path, False )
96
97 i = self.__pathIndex( afterPath )
98 self.__items.insert( i+1, ( path, item ) )
99
100 ## Removes the named menu item. Raises a KeyError if
101 # no such item exists and raiseIfMissing is True.

Callers 1

testMethod · 0.95

Calls 4

removeMethod · 0.95
__pathIndexMethod · 0.95
MenuItemDefinitionClass · 0.90
insertMethod · 0.80

Tested by

no test coverage detected