From 7dbab2478a6ec4c58fef36fabe84b8c611326309 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 2 Sep 2010 06:26:00 -0400 Subject: [PATCH] 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. --- hooke/plugin/curve.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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] -- 2.26.2