Rework Plugin.commands() to include _setup_commands().
[hooke.git] / hooke / plugin / curve.py
index 594f158c5d8462da398580060c01f7e1ab25d725..27fb0cd9fbdc4b7a862ffc5856e1416e7f9ba9eb 100644 (file)
@@ -35,11 +35,11 @@ from ..util.fft import unitary_avg_power_spectrum
 class CurvePlugin (Builtin):
     def __init__(self):
         super(CurvePlugin, self).__init__(name='curve')
-
-    def commands(self):
-        return [InfoCommand(), ExportCommand(),
-                DifferenceCommand(), DerivativeCommand(),
-                PowerSpectrumCommand()]
+        self._commands = [
+            InfoCommand(), ExportCommand(),
+            DifferenceCommand(), DerivativeCommand(),
+            PowerSpectrumCommand()]
+        self._setup_commands()
 
 
 # Define common or complicated arguments
@@ -183,7 +183,7 @@ Column of data block to differentiate.
     def _run(self, hooke, inqueue, outqueue, params):
         a = params['curve'].data[params['block one']]
         b = params['curve'].data[params['block two']]
-        assert a[:,params['x column']] == b[:,params['x column']]:
+        assert a[:,params['x column']] == b[:,params['x column']]
         out = Data((a.shape[0],2), dtype=a.dtype)
         out[:,0] = a[:,params['x column']]
         out[:,1] = a[:,params['f column']] - b[:,params['f column']]
@@ -245,7 +245,7 @@ Column of data block to differentiate with respect to.
                          help="""
 Sampling frequency.
 """.strip()),
-                Argument(name='chunk size', type='int', 2048,
+                Argument(name='chunk size', type='int', default=2048,
                          help="""
 Number of samples per chunk.  Use a power of two.
 """.strip()),