diff options
author | Josh Blum | 2012-11-11 22:17:04 -0800 |
---|---|---|
committer | Josh Blum | 2012-11-11 22:17:04 -0800 |
commit | 5ea36ce4fbf2198c9cc3652d1135247b0e1171f9 (patch) | |
tree | 9d320a9f6374e4c28975af7c808f2ba5eccd13c0 /tests/demo_blocks.py | |
parent | 8f9fedb6846f7304ac4c5ed7ae3233a03b5359b7 (diff) | |
download | sandhi-5ea36ce4fbf2198c9cc3652d1135247b0e1171f9.tar.gz sandhi-5ea36ce4fbf2198c9cc3652d1135247b0e1171f9.tar.bz2 sandhi-5ea36ce4fbf2198c9cc3652d1135247b0e1171f9.zip |
consistency for naming conventions, param orders
Diffstat (limited to 'tests/demo_blocks.py')
-rw-r--r-- | tests/demo_blocks.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/demo_blocks.py b/tests/demo_blocks.py index 9a7a02f..2b2d8dd 100644 --- a/tests/demo_blocks.py +++ b/tests/demo_blocks.py @@ -67,8 +67,9 @@ class TagSource(gras.Block): self._values = values def work(self, ins, outs): - offset = self.nitems_written(0) - self.post_output_tag(0, gras.Tag(offset, 'key', self._values[0])) + offset = self.num_items_produced(0) + tag = gras.Tag(offset, 'key', self._values[0]) + self.post_output_tag(0, tag) self.produce(0, len(outs[0])) self._values = self._values[1:] if not self._values: @@ -86,7 +87,7 @@ class TagSink(gras.Block): return tuple(self._values) def work(self, ins, outs): - max_read = self.nitems_read(0) + len(ins[0]) + max_read = self.num_items_consumed(0) + len(ins[0]) for tag in self.get_input_tags(0): if tag.offset < max_read: self._values.append(tag.value) |