From: W. Trevor King Date: Thu, 2 Sep 2010 10:26:00 +0000 (-0400) Subject: Add 'block names' argument to 'curve info'. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7dbab2478a6ec4c58fef36fabe84b8c611326309;p=hooke.git Add 'block names' argument to 'curve info'. Many commands key off the block name, so there should be a way for the user to determine what the block names are. --- diff --git a/hooke/plugin/curve.py b/hooke/plugin/curve.py index 20d4e5e..dbdace9 100644 --- a/hooke/plugin/curve.py +++ b/hooke/plugin/curve.py @@ -293,7 +293,8 @@ class InfoCommand (CurveCommand): help='Get all curve information.'), ] self.fields = ['name', 'path', 'experiment', 'driver', 'filetype', - 'note', 'command stack', 'blocks', 'block sizes'] + 'note', 'command stack', 'blocks', 'block names', + 'block sizes'] for field in self.fields: args.append(Argument( name=field, type='bool', default=False, count=1, @@ -343,6 +344,9 @@ class InfoCommand (CurveCommand): def _get_blocks(self, curve): return len(curve.data) + def _get_block_names(self, curve): + return [block.info['name'] for block in curve.data] + def _get_block_sizes(self, curve): return [block.shape for block in curve.data]