Did I find the right examples for you? yes no

All Samples(2781)  |  Call(2748)  |  Derive(33)  |  Import(0)
Signal the end from iterator.next().

src/a/s/astral-HEAD/examples/webcam_and_rtmp/multitask.py   astral(Download)
    def child(raise_exc=False):
        yield
        if raise_exc:
            raise RuntimeError('foo')
        raise StopIteration(1, 2, 3)

src/w/e/weightless-core-0.9.4/weightless/examples/ep2011.py   weightless-core(Download)
    def f():
        raise StopIteration("val") #1
        #return "retval"           #2 
        yield
    @compose
    def coroutine_a(n = 0):
        yield                       #1
        print ">", n
        raise StopIteration(n + 1)
    def coroutine_b(n = 0):
def readRequest():
    """More refactoring (parsing)"""
    reql = yield read_req_line()
    hdrs = yield read_headers()
    raise StopIteration([reql, hdrs])
        msg += yield
    req, tail = msg.split('\r\n',1)    #1
    raise StopIteration(req, tail)     #2
 
 
        msg += yield
    result = msg.split('\r\n\r\n')
    raise StopIteration(*result)
 
 

src/w/e/weightless-core-0.9.4/weightless/examples/callbacksvsgenerator.py   weightless-core(Download)
def readUntilEOL():
    fragment = yield
    while not fragment.endswith('\r\n'):
        fragment += (yield)
    raise StopIteration(fragment)

src/a/s/asyncoro-HEAD/examples/rci_monitor_server.py   asyncoro(Download)
        # (remote) monitor (if any) gets this exception (to be
        # interpreted as normal termination)
        raise StopIteration(msg)
    else:
        # (remote) monitor (if any) gets this exception, too

src/a/s/asyncoro-HEAD/examples/pipe_grep.py   asyncoro(Download)
        nlines += 1
    print('lines: %s' % nlines)
    raise StopIteration(nlines)
 
# asyncoro.logger.setLevel(logging.DEBUG)

src/a/s/asyncoro-HEAD/examples/pipe_csum.py   asyncoro(Download)
    def read_proc(pipe, coro=None):
        # output from sha1sum is small, so read until EOF
        data = yield pipe.stdout.read()
        pipe.stdout.close()
        raise StopIteration(data)

src/c/o/cogen-0.2.1/examples/tutor/events-calls.py   cogen(Download)
def bar(what):
    print 'bar'
    raise StopIteration("spam, %s and eggs" % what)
 
sched = Scheduler() 

src/k/i/kiwi-gtk-1.9.38/examples/tasklet/simple.py   kiwi-gtk(Download)
                ## this would be the place to do some cleanup.
                return
        raise StopIteration(self.count*2)
 
def _count_some_numbers1(count):

src/a/s/astral-HEAD/examples/webcam_and_rtmp/rtmp.py   astral(Download)
                if len(self.buffer) >= count: # do not have data in buffer
                    data, self.buffer = self.buffer[:count], self.buffer[count:]
                    raise StopIteration(data)
                if _debug: print 'socket.read[%d] calling recv()'%(count,)
                data = (yield multitask.recv(self.sock, 4096)) # read more from socket

src/h/u/hunch-sample-app-HEAD/django/http/multipartparser.py   hunch-sample-app(Download)
    def next(self):
        try:
            data = self.flo.read(self.chunk_size)
        except InputStreamExhausted:
            raise StopIteration()
        if data:
            return data
        else:
            raise StopIteration()
    def next(self):
        try:
            return LazyStream(BoundaryIter(self._stream, self._boundary))
        except InputStreamExhausted:
            raise StopIteration()
    def next(self):
        if self._done:
            raise StopIteration()
 
        stream = self._stream
 
        if not chunks:
            raise StopIteration()
 
        chunk = ''.join(chunks)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next