From 02ac30a50da20ddae8d1ba141aa351b46ad560a1 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 11 Nov 2010 08:15:54 -0500 Subject: [PATCH] Use hooke.command_by_name[...] in hooke.plugin.*. --- hooke/plugin/convfilt.py | 3 +-- hooke/plugin/flatfilt.py | 3 +-- hooke/plugin/polymer_fit.py | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/hooke/plugin/convfilt.py b/hooke/plugin/convfilt.py index a741f69..59c2f57 100644 --- a/hooke/plugin/convfilt.py +++ b/hooke/plugin/convfilt.py @@ -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) \ diff --git a/hooke/plugin/flatfilt.py b/hooke/plugin/flatfilt.py index 44f0e1f..27caf15 100644 --- a/hooke/plugin/flatfilt.py +++ b/hooke/plugin/flatfilt.py @@ -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) \ diff --git a/hooke/plugin/polymer_fit.py b/hooke/plugin/polymer_fit.py index 9d1a86b..7105e57 100644 --- a/hooke/plugin/polymer_fit.py +++ b/hooke/plugin/polymer_fit.py @@ -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'] -- 2.26.2