Run update-copyright.py.
[hooke.git] / hooke / plugin / tutorial.py
index a126e2cca36a6577fc43a936c041ef0c3097ba7e..00d12e9cd7b4e43100428dac6652ec39ac0c7263 100644 (file)
@@ -1,21 +1,20 @@
-# Copyright (C) 2007-2010 Massimo Sandal <devicerandom@gmail.com>
+# Copyright (C) 2007-2012 Massimo Sandal <devicerandom@gmail.com>
 #                         W. Trevor King <wking@drexel.edu>
 #
 # This file is part of Hooke.
 #
-# Hooke is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# Hooke is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
-# Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
+# details.
 #
-# You should have received a copy of the GNU Lesser General Public
-# License along with Hooke.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with Hooke.  If not, see <http://www.gnu.org/licenses/>.
 
 """This plugin contains example commands to teach how to write an
 Hooke plugin, including description of main Hooke internals.
@@ -23,6 +22,7 @@ Hooke plugin, including description of main Hooke internals.
 
 import logging
 import StringIO
+import sys
 
 from numpy import arange
 
@@ -65,7 +65,7 @@ class TutorialPlugin (Plugin):
         # the plugin is loaded, this function is executed.  If there
         # is something you need to do when Hooke starts, code it in
         # this function.
-        print 'I am the Tutorial plugin initialization!'
+        sys.stderr.write('I am the Tutorial plugin initialization!\n')
 
         # This super() call similar to the old-style
         #   Plugin.__init__
@@ -220,6 +220,8 @@ class HookeInfoCommand (Command):
         hooke.config.write(config_file)
         outqueue.put('configuration:\n  %s'
                      % '\n  '.join(config_file.getvalue().splitlines()))
+        # The plugin's configuration settings are also available.
+        outqueue.put('plugin config: %s' % self.plugin.config)
         # hooke.plugins contains :class:`hooke.plugin.Plugin`\s defining
         # :class:`hooke.command.Command`\s.
         outqueue.put('plugins: %s'
@@ -228,9 +230,9 @@ class HookeInfoCommand (Command):
         # loading curves.
         outqueue.put('drivers: %s'
                      % ', '.join([driver.name for driver in hooke.drivers]))
-        # hooke.playlists contains a
-        # :class:`hooke.playlist.NoteIndexList` of
-        # :class:`hooke.playlist.Playlist`\s.  Each playlist may
+        # hooke.playlists is a
+        # :class:`hooke.playlist.Playlists` instance full of
+        # :class:`hooke.playlist.FilePlaylist`\s.  Each playlist may
         # contain several :class:`hooke.curve.Curve`\s representing a
         # grouped collection of data.
         playlist = hooke.playlists.current()
@@ -250,7 +252,7 @@ class HookeInfoCommand (Command):
 
 
 class PointInfoCommand (Command):
-    """Get information about two user-selected points.
+    """Get information about user-selected points.
 
     Ordinarily a command that knew it would need user selected points
     would declare an appropriate argument (see, for example,