Package ghidra.python

# Class PythonPlugin

java.lang.Object
ghidra.framework.plugintool.Plugin
ghidra.app.plugin.ProgramPlugin
ghidra.python.PythonPlugin

All Implemented Interfaces:
  `ghidra.app.plugin.core.interpreter.InterpreterConnection`, `OptionsChangeListener`, `PluginEventListener`, `ServiceListener`, `ExtensionPoint`

public class PythonPlugin extends ProgramPlugin implements ghidra.app.plugin.core.interpreter.InterpreterConnection, OptionsChangeListener
This plugin provides the interactive Python interpreter.

- ## Field Summary

  ### Fields inherited from class ghidra.app.plugin.ProgramPlugin

  `currentHighlight, currentLocation, currentProgram, currentSelection`

  ### Fields inherited from class ghidra.framework.plugintool.Plugin

  `name, pluginDescription, tool`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PythonPlugin(PluginTool tool)`
  Creates a new PythonPlugin object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `dispose()`
  Tells a plugin that it is no longer needed.
  `List<ghidra.app.plugin.core.console.CodeCompletion>`
  `getCompletions(String cmd)`
  Returns a list of possible command completion values.
  `List<ghidra.app.plugin.core.console.CodeCompletion>`
  `getCompletions(String cmd, int caretPos)`
  Returns a list of possible command completion values at the given position.
  `Icon`
  `getIcon()`
  `String`
  `getTitle()`
  `protected void`
  `init()`
  Initialization method; override to add initialization for this plugin.
  `void`
  `interrupt()`
  Interrupts what the interpreter is currently doing.
  `void`
  `optionsChanged(ToolOptions options, String optionName, Object oldValue, Object newValue)`
  Handle a change in one of our options.
  `void`
  `reset()`
  Resets the interpreter's state.
  `String`
  `toString()`

  ### Methods inherited from class ghidra.app.plugin.ProgramPlugin

  `getCurrentProgram, getProgramHighlight, getProgramLocation, getProgramSelection, goTo, goTo, highlightChanged, locationChanged, postProgramActivated, processEvent, programActivated, programClosed, programDeactivated, programOpened, selectionChanged, setSelection`

  ### Methods inherited from class ghidra.framework.plugintool.Plugin

  `accept, acceptData, canClose, canCloseDomainObject, cleanup, close, dataStateRestoreCompleted, dependsUpon, deregisterService, equals, eventSent, firePluginEvent, getData, getMissingRequiredServices, getName, getPluginDescription, getServicesRequired, getSupportedDataTypes, getTool, getTransientState, getUndoRedoState, hashCode, hasMissingRequiredService, hasUnsaveData, internalRegisterEventConsumed, isDisposed, prepareToSave, readConfigState, readDataState, registerDynamicServiceProvided, registerServiceProvided, restoreTransientState, restoreUndoRedoState, saveData, serviceAdded, serviceRemoved, writeConfigState, writeDataState`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### PythonPlugin

    public PythonPlugin(PluginTool tool)
    Creates a new PythonPlugin object.
    Parameters:
      `tool` - The tool associated with this plugin.

- ## Method Details

  - ### init

    protected void init()
    Description copied from class: `Plugin`
    Initialization method; override to add initialization for this plugin. This is where a plugin should acquire its services. When this method is called, all plugins have been instantiated in the tool.
    Overrides:
      `init` in class `Plugin`

  - ### optionsChanged

    public void optionsChanged(ToolOptions options, String optionName, Object oldValue, Object newValue)
    Handle a change in one of our options.
    Specified by:
      `optionsChanged` in interface `OptionsChangeListener`
    Parameters:
      `options` - the options handle
      `optionName` - name of the option changed
      `oldValue` - the old value
      `newValue` - the new value

  - ### getCompletions

    public List<ghidra.app.plugin.core.console.CodeCompletion> getCompletions(String cmd)
    Returns a list of possible command completion values.
    Specified by:
      `getCompletions` in interface `ghidra.app.plugin.core.interpreter.InterpreterConnection`
    Parameters:
      `cmd` - current command line (without prompt)
    Returns:
      A list of possible command completion values. Could be empty if there aren't any.

  - ### getCompletions

    public List<ghidra.app.plugin.core.console.CodeCompletion> getCompletions(String cmd, int caretPos)
    Returns a list of possible command completion values at the given position.
    Specified by:
      `getCompletions` in interface `ghidra.app.plugin.core.interpreter.InterpreterConnection`
    Parameters:
      `cmd` - current command line (without prompt)
      `caretPos` - The position of the caret in the input string 'cmd'
    Returns:
      A list of possible command completion values. Could be empty if there aren't any.

  - ### dispose

    protected void dispose()
    Description copied from class: `Plugin`
    Tells a plugin that it is no longer needed. The plugin should release any resources that it has. All actions, components, services will automatically be cleaned up.
    Overrides:
      `dispose` in class `Plugin`

  - ### interrupt

    public void interrupt()
    Interrupts what the interpreter is currently doing.

  - ### reset

    public void reset()
    Resets the interpreter's state.

  - ### getTitle

    public String getTitle()
    Specified by:
      `getTitle` in interface `ghidra.app.plugin.core.interpreter.InterpreterConnection`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getIcon

    public Icon getIcon()
    Specified by:
      `getIcon` in interface `ghidra.app.plugin.core.interpreter.InterpreterConnection`