# pipetruncate.py
#

from pipe2py import util

def pipe_truncate(context, _INPUT, conf, **kwargs):
    """This operator truncates the number of items in a feed.

    Keyword arguments:
    context -- pipeline context
    _INPUT -- source generator
    kwargs -- terminal, if the truncation value is wired in
    conf:
        count -- length of the truncated feed, if specified literally
        
    Yields (_OUTPUT):
    truncated list of source items
    """

    count = conf['count']
    limit = int(util.get_value(count, None, **kwargs))
    for i in xrange(0, limit):
        yield _INPUT.next()
    
@@ -537,16 +537,26 @@
 wargs))%0A
+    i = 0%0A
     for 
@@ -560,28 +560,44 @@
 or i
+tem
  in 
-xrange(0,
+_INPUT:%0A        if i %3E=
  limit
-)
 :%0A  
@@ -606,28 +606,48 @@
     
-yield _INPUT.next()%0A    
+    break%0A        yield item%0A        i += 1%0A

Fix for taking feed from a split output