コード例 #1
0
ファイル: home_stats.py プロジェクト: hevi9/hevi-home
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
ファイル: home_stats.py プロジェクト: hevi9/hevi-home
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
ファイル: test_formats.py プロジェクト: hevi9/hevi-lib
def test_bytes_1():
    """ test bytes with zero value """
    bytes(0)