From 4bf07aa8a6d2bf78d18557ebe76bd9d6af0589ae Mon Sep 17 00:00:00 2001 From: Howard Jones Date: Sun, 17 Aug 2014 19:11:01 +0100 Subject: [PATCH] Changed to not require collections collections library is only available in Py 2.7+ --- beets/ui/commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 39cf2a6c7..0e2a15ae2 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -24,7 +24,6 @@ import itertools import codecs import platform import re -import collections import beets from beets import ui @@ -745,9 +744,10 @@ class TerminalImportSession(importer.ImportSession): def summarize_items(self,items): summary_text = "" summary_text += "%d items. " % len(items) - - format_counts = collections.Counter( [item[1] for item in items] ) - + format_counts = {} + for item in items: + format_counts[item[1]] = format_counts.get(item[1],0) + 1; + for format, count in format_counts.iteritems(): summary_text += '{count} {format}. '.format(format=format, count=count)