def encode_block(block): lines = [] lines.append(encode_kv_pairs(block)) lines.append(encode_frames(block)) lines.append(encode_loops(block)) lines = [l for l in lines if len(l)] return '\n'.join(lines)
def encode_frame(frame): lines = [] lines.append(encode_kv_pairs(frame)) lines.append(encode_loops(frame)) return '\n'.join(lines)