Use hooke.command_by_name[...] in hooke.plugin.*.
authorW. Trevor King <wking@drexel.edu>
Thu, 11 Nov 2010 13:15:54 +0000 (08:15 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 11 Nov 2010 13:15:54 +0000 (08:15 -0500)
hooke/plugin/convfilt.py
hooke/plugin/flatfilt.py
hooke/plugin/polymer_fit.py

index a741f69..59c2f57 100644 (file)
@@ -200,8 +200,7 @@ class ConvolutionFilterCommand (FilterCommand):
         params['curve'] = curve
         inq = Queue()
         outq = Queue()
-        conv_command = [c for c in self.hooke.commands
-                        if c.name=='convolution peaks'][0]
+        conv_command = self.hooke.command_by_name['convolution peaks']
         conv_command.run(hooke, inq, outq, **params)
         peaks = outq.get()
         if isinstance(peaks, UncaughtException) \
index 44f0e1f..27caf15 100644 (file)
@@ -222,8 +222,7 @@ class FlatFilterCommand (FilterCommand):
         params['curve'] = curve
         inq = Queue()
         outq = Queue()
-        filt_command = [c for c in hooke.commands
-                        if c.name=='flat filter peaks'][0]
+        filt_command = hooke.command_by_name['flat filter peaks']
         filt_command.run(hooke, inq, outq, **params)
         peaks = outq.get()
         if isinstance(peaks, UncaughtException) \
index 9d1a86b..7105e57 100644 (file)
@@ -1089,8 +1089,7 @@ Index of the selected peak in the list of peaks.  Use `None` to fit all peaks.
 
     def _run(self, hooke, inqueue, outqueue, params):
         data = self._block(hooke, params)
-        fit_command = [c for c in hooke.commands
-                       if c.name=='polymer fit'][0]
+        fit_command = hooke.command_by_name['polymer fit']
         inq = Queue()
         outq = Queue()
         curve = params['curve']