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

Method insertBefore

python/IECore/MenuDefinition.py:79–87  ·  view source on GitHub ↗
( self, path, item, beforePath )

Source from the content-addressed store, hash-verified

77
78 ## Insert a menu item before the specified menu item.
79 def insertBefore( self, path, item, beforePath ) :
80
81 if isinstance( item, dict ) :
82 item = MenuItemDefinition( item )
83
84 self.remove( path, False )
85
86 i = self.__pathIndex( beforePath )
87 self.__items.insert( i, ( path, item ) )
88
89 ## Insert a menu item after the specified menu item.
90 def insertAfter( self, path, item, afterPath ) :

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