-import numpy as np
-
-from .. import curve as lhc
-
-'''
-SYNTAX OF DATA TYPE DECLARATION:
- type = type of object
- [ type ] = list containing objects of type
- {typekey:typearg} = dictionary with keys of type typekey and args of type typearg
- ( type ) = tuple containing objects of type
-'''
-
-
-class tutorialCommands(object):
- '''
- Here we define the class containing all the Hooke commands we want to define
- in the plugin.
-
- Notice the class name!!
- The syntax is filenameCommands. That is, if your plugin is pluggy.py, your class
- name is pluggyCommands.
-
- Otherwise, the class will be ignored by Hooke.
- '''
-
- def _plug_init(self):
- '''
- This is the plugin initialization.
- When Hooke starts and the plugin is loaded, this function is executed.
- If there is something you need to do when Hooke starts, code it in this function.
- '''
+from numpy import arange
+
+from ..command import Command, Argument, Failure
+from ..playlist import FilePlaylist
+from ..plugin import Plugin
+
+
+class TutorialPlugin (Plugin):
+ """An example plugin explaining how to code plugins.
+
+ Unlike previous versions of Hooke, the class name is no longer
+ important. Plugins identify themselves to
+ :func:`hooke.util.pluggable.construct_graph` by being subclasses
+ of :class:`hooke.plugin.Plugin`. However, for consistency we
+ suggest the following naming scheme, show here for the 'tutorial'
+ plugin:
+
+ =========== ==============
+ module file tutorial.py
+ class name TutorialPlugin
+ .name 'tutorial'
+ =========== ==============
+
+ To ensure filename sanity,
+ :func:`hooke.util.pluggable.construct_graph` requires that
+ :attr:`name` does match the submodule name, but don't worry,
+ you'll get a clear exception message if you make a mistake.
+ """
+ def __init__(self):
+ """TutorialPlugin initialization code.
+
+ We call our base class' :meth:`__init__` and setup
+ :attr:`_commands`.
+ """
+ # This is the plugin initialization. When Hooke starts and
+ # the plugin is loaded, this function is executed. If there
+ # is something you need to do when Hooke starts, code it in
+ # this function.