Skip to content

Commit

Permalink
Document terminate() Method for Python Plugins (#1387)
Browse files Browse the repository at this point in the history
  • Loading branch information
thestr4ng3r authored Apr 14, 2019
1 parent 7eb62a9 commit 926b741
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/source/plugins/tutorial-python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Create a python file, called ``myplugin.py`` for example, and add the following
def setupInterface(self, main):
pass
def terminate(self):
pass
def create_cutter_plugin():
return MyCutterPlugin()
Expand All @@ -39,6 +42,7 @@ The ``CutterPlugin`` subclass contains some meta-info and two callback methods:

* ``setupPlugin()`` is called right after the plugin is loaded and can be used to initialize the plugin itself.
* ``setupInterface()`` is called with the instance of MainWindow as an argument and should create and register any UI components.
* ``terminate()`` is called on shutdown and should clean up any resources used by the plugin.

Copy this file into the ``python`` subdirectory located under the plugins directory of Cutter and start the application.
You should see an entry for your plugin in the list under Edit -> Preferences -> Plugins.
Expand Down Expand Up @@ -251,5 +255,8 @@ Full Code
widget = MyDockWidget(main, action)
main.addPluginDockWidget(widget, action)
def terminate(self):
pass
def create_cutter_plugin():
return MyCutterPlugin()

0 comments on commit 926b741

Please sign in to comment.