Skip to content

Commit

Permalink
Sort groups in all_groups.
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipkoebbe committed Apr 20, 2012
1 parent 798df0f commit c9ee1e1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion favorites.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,15 @@ def group_count(self):

def all_groups(self):
# Return all groups
return [["Group: " + k, "%d files" % len(v)] for k, v in self.obj.files["groups"].items()]
groups = []
for group in self.obj.files["groups"]:
groups.append(group)

groups.sort()

all_groups = []
for group in groups:
files = self.obj.files["groups"].get(group)
all_groups.append(["Group: " + group, "%d files" % len(files)])

return all_groups

0 comments on commit c9ee1e1

Please sign in to comment.