Skip to content

Instantly share code, notes, and snippets.

@kmaglione
Created July 28, 2015 20:13
Show Gist options
  • Save kmaglione/591f288ca246a4c11e89 to your computer and use it in GitHub Desktop.
Save kmaglione/591f288ca246a4c11e89 to your computer and use it in GitHub Desktop.
def all_distinct_files(context, version):
hashes_to_file = defaultdict(list)
for file_ in version.all_files:
hashes_to_file[file_.hash].append(amo.PLATFORMS[file_.platform].name)
return new_context(context,
distinct_files=[' / '.join(platforms) for platforms in hashes_to_file.itervalues()],
version=version)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment