From: W. Trevor King Date: Sat, 21 Aug 2010 20:11:12 +0000 (-0400) Subject: Added command_stack option to all' default. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2acea22a3782a3f108a1c65f98a0eb36afdceb9e;p=hooke.git Added command_stack option to all' default. --- diff --git a/hooke/plugin/curve.py b/hooke/plugin/curve.py index d58d660..931dca3 100644 --- a/hooke/plugin/curve.py +++ b/hooke/plugin/curve.py @@ -285,8 +285,8 @@ class InfoCommand (CurveCommand): Argument(name='all', type='bool', default=False, count=1, help='Get all curve information.'), ] - self.fields = ['name', 'path', 'experiment', 'driver', 'filetype', 'note', - 'blocks', 'block sizes'] + self.fields = ['name', 'path', 'experiment', 'driver', 'filetype', + 'note', 'command stack', 'blocks', 'block sizes'] for field in self.fields: args.append(Argument( name=field, type='bool', default=False, count=1, @@ -300,7 +300,7 @@ class InfoCommand (CurveCommand): fields = {} for key in self.fields: fields[key] = params[key] - if reduce(lambda x,y: x and y, fields.values()) == False: + if reduce(lambda x,y: x or y, fields.values()) == False: params['all'] = True # No specific fields set, default to 'all' if params['all'] == True: for key in self.fields: @@ -330,6 +330,9 @@ class InfoCommand (CurveCommand): def _get_note(self, curve): return curve.info.get('note', None) + def _get_command_stack(self, curve): + return curve.command_stack + def _get_blocks(self, curve): return len(curve.data)