# HG changeset patch # User drewp # Date 2003-07-08 09:18:47 # Node ID 1fe54442db38f55d6e2dbb6d2c2dd0c30ba8edc2 # Parent bd2bcc9d38bb1365409ed0b91c2f509b84f651dc get_all_subs sorts, and puts some elements at the end diff --git a/flax/Submaster.py b/flax/Submaster.py --- a/flax/Submaster.py +++ b/flax/Submaster.py @@ -92,7 +92,18 @@ class Submasters: self.submasters[filename] = Submaster(filename) def get_all_subs(self): "All Submaster objects" - return self.submasters.values() + l = self.submasters.items() + l.sort() + l = [x[1] for x in l] + songs = [] + notsongs = [] + for s in l: + if s.name.startswith('song'): + songs.append(s) + else: + notsongs.append(s) + combined = notsongs + songs + return combined def get_sub_by_name(self, name): "Makes a new sub if there isn't one." return self.submasters.get(name, Submaster(name))