summaryrefslogtreecommitdiff
path: root/python/gras
diff options
context:
space:
mode:
authorJosh Blum2012-11-09 01:39:33 -0800
committerJosh Blum2012-11-09 01:39:33 -0800
commita6e4b123a003b6a273d2ed674efbfb08bf949043 (patch)
tree7ccea66f34dbeb48cb1fa7999c6644aa58989b8a /python/gras
parent8bc79efc631b7b86e7e8b1f6afaccc51db49699f (diff)
downloadsandhi-a6e4b123a003b6a273d2ed674efbfb08bf949043.tar.gz
sandhi-a6e4b123a003b6a273d2ed674efbfb08bf949043.tar.bz2
sandhi-a6e4b123a003b6a273d2ed674efbfb08bf949043.zip
created get_input_tags pythonic wrapper
Diffstat (limited to 'python/gras')
-rw-r--r--python/gras/GRAS_Block.i16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/gras/GRAS_Block.i b/python/gras/GRAS_Block.i
index a7e27fc..1c04cb6 100644
--- a/python/gras/GRAS_Block.i
+++ b/python/gras/GRAS_Block.i
@@ -171,6 +171,13 @@ struct BlockPython : Block
const std::vector<void *> &,
const std::vector<size_t> &
) = 0;
+
+ std::vector<Tag> get_input_tags(const size_t which_input)
+ {
+ Block::TagIter it = Block::get_input_tags(which_input);
+ std::vector<Tag> tags(it.begin(), it.end());
+ return tags;
+ }
};
}
@@ -290,4 +297,13 @@ class Block(BlockPython):
)
BlockPython.post_output_tag(self, which_output, t)
+ def get_input_tags(self, which_input):
+ for t in BlockPython.get_input_tags(self, which_input):
+ yield Tag(
+ offset=t.offset,
+ key=PMC2Py(t.key),
+ value=PMC2Py(t.value),
+ srcid=PMC2Py(t.srcid),
+ )
+
%}