コード例 #1
0
ファイル: gutilstest.py プロジェクト: blep/weightless-core
 def helper():
     t = target(); t.next()
     yield copyBytes(2, t)
     try:
         yield t.throw(StopIteration)
     except StopIteration:
         pass
     while True: yield
コード例 #2
0
ファイル: gutilstest.py プロジェクト: blep/weightless-core
 def protocol():
     yield copyBytes(1, appl)
     try:
         yield appl.throw(StopIteration)
     except StopIteration:
         pass
     yield 'B'
     yield 'C'
     b = yield
     yield b
コード例 #3
0
def feedChunks(handler):
    handler.next()
    while True:
        chunkSizeLine = yield readRe(REGEXP.CHUNK_SIZE_LINE, MAXREQUESTSIZE)
        size = int(chunkSizeLine['ChunkSize'], 16)
        if size == 0:
            yield handler.throw(StopIteration())
            break
        yield copyBytes(size, handler)
        yield readRe(REGEXP.CRLF, 2)
    for partialResponse in handler:
        yield partialResponse
コード例 #4
0
 def processRequest(self, ContentLength=None, **kwargs):
     yield copyBytes(ContentLength, buff.sink())
     yield 'HTTP/1.1 200 Ok\r\n'
コード例 #5
0
 def processRequest(self, ContentLength=None, **kwargs):
     yield copyBytes(ContentLength, buff.sink())
     yield 'HTTP/1.1 200 Ok\r\n'
コード例 #6
0
ファイル: gutilstest.py プロジェクト: blep/weightless-core
 def helper():
     c1 = collector(basket,[None for x in range(99999)]); c1.next()
     yield copyBytes(sliceLen, c1)
     while True:
         restbasket.append((yield))
コード例 #7
0
ファイル: gutilstest.py プロジェクト: blep/weightless-core
 def helper():
     c1 = collector(basket, responses); c1.next()
     yield copyBytes(bytes, c1)
     while True:
         restbasket.append((yield))
コード例 #8
0
ファイル: gutilstest.py プロジェクト: blep/weightless-core
 def protocol():
     yield copyBytes(1, appl)
     yield appl.throw(StopIteration)
     yield 'B'
     b = yield
     yield b