| | |
- builtins.object
-
- Fragment
- NullBuilder
- StreamBuilder
-
- FileBuilder
class Fragment(builtins.object) |
| |
Fragment(id)
|
| |
Methods defined here:
- __init__(self, id)
- Initialize self. See help(type(self)) for accurate signature.
- flush(self, tempFile, out)
- フラグメントの内容を吐き出して、フラグメントを破棄します。
tempFile: 一時ファイル
out: 出力先ストリーム( IO )
- write(self, tempFile, onMemory, segment, bytes)
- フラグメントにデータを書き込みます。
tempFile: 一時ファイル
onMemory: メモリ上に置かれたデータの合計サイズ
segment: セグメント番号シーケンス
bytes: データ
戻り値: 書き込んだバイト数
Data descriptors defined here:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
|
class StreamBuilder(builtins.object) |
| |
StreamBuilder(out, finish_func=None)
ストリームに対して結果を構築するオブジェクトです。 |
| |
Methods defined here:
- __init__(self, out, finish_func=None)
- 結果構築オブジェクトを作成します。
out: 出力先ストリーム
finish_func: 結果を実際に出力する前に呼び出されるコールバック関数。引数として結果のバイト数が渡されます
例:
def content_type(opts):
print("Content-Type: "+opts['mime_type'])
def content_length(length):
print("Content-Length: "+str(length))
print()
results = SingleResult(StreamBuilder(sys.stdout, content_length), content_type)
- add_block(self)
- block_write(self, id, data)
- close_block(self, id)
- dispose(self)
- finish(self)
- insert_block_before(self, anchor_id)
- serial_write(self, data)
Data descriptors defined here:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
| |