Fix typo .add -> .append in plugin.playlist.FilterCommand
[hooke.git] / hooke / plugin / cut.py
index 369cfcc3b7fa86d49df9ac776a7953e8bd5f8e41..2771ef5bb4a574ebe37e26160349badcaaf62c98 100644 (file)
@@ -1,3 +1,23 @@
+# Copyright (C) 2009-2010 Fabrizio Benedetti
+#                         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 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/>.
+
 """The `cut` module provides :class:`CutPlugin` and
 :class:`CutCommand`.
 """
@@ -9,9 +29,7 @@ from ..plugin import Plugin
 class CutPlugin (Plugin):
     def __init__(self):
         super(CutPlugin, self).__init__(name='cut')
-
-    def commands(self):
-        return [CutCommand()]
+        self._commands = [CutCommand(self)]
 
 
 # Define common or complicated arguments
@@ -40,7 +58,7 @@ class CutCommand (Command):
     The data is saved in TAB-delimited ASCII text, where the first column
     is "x" and the second is "y".  There is no header row.
     """
-    def __init__(self):
+    def __init__(self, plugin):
         super(CutCommand, self).__init__(
             name='cut',
             arguments=[
@@ -59,7 +77,7 @@ Indicies of points bounding the selected data.
 File name for the output data.
 """.strip()),
                 ],
-            help=self.__doc__)
+            help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
         if params['curve'] == None: