Ignore saved-web-page assets; hash on same line as filename.
Chris Pressey
9 years ago
47 | 47 | |
48 | 48 | def traverse_directory(directory, sizemap): |
49 | 49 | for root, dirs, files in os.walk(directory): |
50 | dirs[:] = [d for d in dirs if not d.endswith('_files')] | |
50 | 51 | for filename in files: |
51 | 52 | full = os.path.normpath(os.path.join(root, filename)) |
52 | 53 | if os.path.islink(full): |
87 | 88 | for hash in hashmap: |
88 | 89 | filenames = sorted(hashmap[hash]) |
89 | 90 | if len(filenames) > 1: |
90 | print "# %s:" % hash | |
91 | 91 | for filename in filenames: |
92 | print "# %s" % filename | |
92 | print "%s\t%s" % (hash, filename) | |
93 | 93 | else: |
94 | 94 | |
95 | 95 | for hash in hashmap: |