Пример #1
0
def report_short(stats):
    print("{}:".format(stats.root))
    print("  {} files {} dirs {} links {} mounts {} errors {} size".format(
        stats.regs,
        stats.dirs,
        stats.links,
        stats.mounts,
        stats.errors,
        bytes(stats.size),
    ))
    for stat in stats.data.values():
        print("  {} {}".format(stat.value, stat.name))
Пример #2
0
def report_long(stats):
    print("{}:".format(stats.root))
    print("  {} files {} dirs {} links {} mounts {} errors {} size".format(
        stats.regs,
        stats.dirs,
        stats.links,
        stats.mounts,
        stats.errors,
        bytes(stats.size),
    ))
    for stat in stats.data.values():
        print("  {} {}".format(stat.value, stat.name))
        if isinstance(stat, StatFiles):
            for path in stat.files:
                print("    {}".format(path))
Пример #3
0
def test_bytes_1():
    """ test bytes with zero value """
    bytes(0)