def addPluginsParentToMenu(directoryPath, menu, parentPath, pluginFileNames):
 ToolDialog().addPluginToMenu(menu, parentPath[:parentPath.rfind('.')])
 menu.add_separator()
 addPluginsToMenu(directoryPath, menu, pluginFileNames)

def addPluginsParentToMenu ( directoryPath , menu , parentPath , pluginFileNames ) : ToolDialog ( ) . addPluginToMenu ( menu , parentPath [ : parentPath . rfind ( '.' ) ] ) menu . add_separator ( ) addPluginsToMenu ( directoryPath , menu , pluginFileNames )
add plugins and the parent to the menu .