class SearchReplacePanel( nukescripts.PythonPanel ):
    def __init__( self ):
        nukescripts.PythonPanel.__init__( self, 'Search and Replace', 'com.ohufx.SearchReplace')
        # CREATE KNOBS
        self.nodesChoice = nuke.Enumeration_Knob( 'nodes', 'Source Nodes', ['all', 'selected'])
        self.searchStr = nuke.String_Knob('searchStr', 'Search for:')
        self.update = nuke.PyScript_Knob('update', 'Update')
        self.info = nuke.Multiline_Eval_String_Knob('info', 'Found')
        self.info.setEnabled( False )
        self.replaceStr = nuke.String_Knob('replaceStr', 'Replace with:')
        self.replace = nuke.PyScript_Knob('replace', 'Replace')
        # ADD KNOBS
        self.addKnob( self.nodesChoice )
        self.addKnob( self.searchStr )
        self.addKnob( self.update )
        self.addKnob( self.info )
        self.addKnob( self.replaceStr )
        self.addKnob( self.replace )

def addPanel():
    return SearchReplacePanel().addToPane()

menu = nuke.menu('Pane')
menu.addCommand('Search and Replace', addPanel )
nukescripts.registerPanel( 'com.ohufx.SearchReplace', addPanel )