67
67
yield DirEntry(name=entry.name, node_type=entry.node_type,
70
71
def by_utf8_name(entry_a, entry_b):
71
72
"""Compares two entries by the UTF-8 form of their names."""
72
73
return cmp(entry_a.utf8_name, entry_b.utf8_name)
74
76
def write_dir_content(entries, stream):
75
77
"""Takes a sequence of DirEntry objects, sorts them, and writes
76
78
the corresponding serialized directory content to the given stream.