def serialize_tree(items):
 for (name, mode, hexsha) in items:
  (yield ((((('%04o' % mode).encode('ascii') + ' ') + name) + '\x00') + hex_to_sha(hexsha)))

def serialize_tree ( items ) : for ( name , mode , hexsha ) in items : ( yield ( ( ( ( ( '%04o' % mode ) . encode ( 'ascii' ) + ' ' ) + name ) + '\x00' ) + hex_to_sha ( hexsha ) ) )
serialize the items in a tree to a text .