Module Expr Str ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str keyword Num Expr Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Str decorator_list decorator_list
N/A N/A 
Skeleton example of a Ginga local plugin called 'MyLocalPlugin'

To enable it, run ginga with the command
    $ ginga --plugins=MyLocalPlugin

it will then be available from the "Operations" button.

 ginga GingaPlugin ginga.gw Widgets MyLocalPlugin N/A N/A GingaPlugin LocalPlugin N/A __init__ N/A N/A self fv fitsimage N/A N/A N/A 
        This method is called when the plugin is loaded for the  first
        time.  ``fv`` is a reference to the Ginga (reference viewer) shell
        and ``fitsimage`` is a reference to the specific ImageViewCanvas
        object associated with the channel on which the plugin is being
        invoked.
        You need to call the superclass initializer and then do any local
        initialization.
         N/A N/A N/A N/A super MyLocalPlugin self __init__ fv fitsimage N/A build_gui N/A N/A self container N/A N/A N/A 
        This method is called when the plugin is invoked.  It builds the
        GUI used by the plugin into the widget layout passed as
        ``container``.
        This method may be called many times as the plugin is opened and
        closed for modal operations.  The method may be omitted if there
        is no GUI for the plugin.

        This specific example uses the GUI widget set agnostic wrappers
        to build the GUI, but you can also just as easily use explicit
        toolkit calls here if you only want to support one widget set.
         N/A top N/A N/A Widgets VBox N/A N/A N/A top set_border_width 4 N/A N/A vbox sw orientation N/A N/A Widgets get_oriented_box container N/A N/A N/A vbox set_border_width 4 N/A N/A N/A vbox set_spacing 2 N/A N/A self msgFont N/A N/A N/A self fv getFont sansFont 12 N/A tw N/A N/A Widgets TextArea wrap True editable False N/A N/A N/A tw set_font N/A self msgFont N/A N/A self tw tw N/A fr N/A N/A Widgets Expander Instructions N/A N/A N/A fr set_widget tw N/A N/A N/A vbox add_widget fr stretch 0 N/A spacer N/A N/A Widgets Label N/A N/A N/A vbox add_widget spacer stretch 1 N/A N/A N/A top add_widget sw stretch 1 N/A btns N/A N/A Widgets HBox N/A N/A N/A btns set_spacing 3 N/A btn N/A N/A Widgets Button Close N/A N/A N/A btn add_callback activated N/A N/A N/A w N/A N/A N/A self close N/A N/A N/A btns add_widget btn stretch 0 N/A N/A N/A btns add_widget N/A N/A Widgets Label stretch 1 N/A N/A N/A top add_widget btns stretch 0 N/A N/A N/A container add_widget top stretch 1 N/A close N/A N/A self N/A N/A N/A 
        Example close method.  You can use this method and attach it as a
        callback to a button that you place in your GUI to close the plugin
        as a convenience to the user.
         N/A N/A N/A N/A self fv stop_local_plugin N/A self chname N/A str self N/A True N/A start N/A N/A self N/A N/A N/A 
        This method is called just after ``build_gui()`` when the plugin
        is invoked.  This method may be called many times as the plugin is
        opened and closed for modal operations.  This method may be omitted
        in many cases.
         N/A N/A N/A N/A self tw set_text This plugin doesn't do anything interesting. N/A N/A N/A self resume N/A pause N/A N/A self N/A N/A N/A 
        This method is called when the plugin loses focus.
        It should take any actions necessary to stop handling user
        interaction events that were initiated in ``start()`` or
        ``resume()``.
        This method may be called many times as the plugin is focused
        or defocused.  It may be omitted if there is no user event handling
        to disable.
         N/A N/A resume N/A N/A self N/A N/A N/A 
        This method is called when the plugin gets focus.
        It should take any actions necessary to start handling user
        interaction events for the operations that it does.
        This method may be called many times as the plugin is focused or
        defocused.  The method may be omitted if there is no user event
        handling to enable.
         N/A N/A stop N/A N/A self N/A N/A N/A 
        This method is called when the plugin is stopped.
        It should perform any special clean up necessary to terminate
        the operation.  The GUI will be destroyed by the plugin manager
        so there is no need for the stop method to do that.
        This method may be called many  times as the plugin is opened and
        closed for modal operations, and may be omitted if there is no
        special cleanup required when stopping.
         N/A N/A redo N/A N/A self N/A N/A N/A 
        This method is called when the plugin is active and a new
        image is loaded into the associated channel.  It can optionally
        redo the current operation on the new image.  This method may be
        called many times as new images are loaded while the plugin is
        active.  This method may be omitted.
         N/A N/A __str__ N/A N/A self N/A N/A N/A 
        This method should be provided and should return the lower case
        name of the plugin.
         N/A mylocalplugin N/A N/A