changeset 165:1fe54442db38

get_all_subs sorts, and puts some elements at the end
author drewp
date Tue, 08 Jul 2003 09:18:47 +0000
parents bd2bcc9d38bb
children 7ccf1d10804b
files flax/Submaster.py
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flax/Submaster.py	Tue Jul 08 09:17:46 2003 +0000
+++ b/flax/Submaster.py	Tue Jul 08 09:18:47 2003 +0000
@@ -92,7 +92,18 @@
             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))